summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-02-27 10:04:26 -0800
committerJunio C Hamano <gitster@pobox.com>2013-02-27 10:04:26 -0800
commit6f0c33666300ccf95eb4b4e723e07a3c588d12db (patch)
treea70a955112a0fbaa9aac9956a2521259ee4f7b0c
parent28db11169b53695827b180e4ee11c33bf2ec116a (diff)
parentb141a47801d6fb2d68ec48adfe7597ec3ce49c0d (diff)
downloadgit-6f0c33666300ccf95eb4b4e723e07a3c588d12db.tar.gz
Merge branch 'ef/non-ascii-parse-options-error-diag' into maint
* 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 670bf09b45..7ca8f2caef 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -471,8 +471,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);
}