summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-02-14 16:06:14 -0800
committerJunio C Hamano <gitster@pobox.com>2013-02-14 16:06:14 -0800
commit6bdecc8f56a06f085b4444dc29361a5aa80d9eef (patch)
tree5fcc6582b7febaa14560a9a53d0cf50365b43f3d
parentbfc1f6a1c18b3b0eba7e9126fb0b2688f865a110 (diff)
parentb141a47801d6fb2d68ec48adfe7597ec3ce49c0d (diff)
downloadgit-6bdecc8f56a06f085b4444dc29361a5aa80d9eef.tar.gz
Merge branch 'ef/non-ascii-parse-options-error-diag'
* ef/non-ascii-parse-options-error-diag: parse-options: report uncorrupted multi-byte options
-rw-r--r--parse-options.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/parse-options.c b/parse-options.c
index a6ce9efb79..c2cbca25cc 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -462,8 +462,11 @@ int parse_options(int argc, const char **argv, const char *prefix,
default: /* PARSE_OPT_UNKNOWN */
if (ctx.argv[0][1] == '-') {
error("unknown option `%s'", ctx.argv[0] + 2);
- } else {
+ } else if (isascii(*ctx.opt)) {
error("unknown switch `%c'", *ctx.opt);
+ } else {
+ error("unknown non-ascii option in string: `%s'",
+ ctx.argv[0]);
}
usage_with_options(usagestr, options);
}