Permalink
Browse files

Merge branch 'ef/non-ascii-parse-options-error-diag'

* ef/non-ascii-parse-options-error-diag:
  parse-options: report uncorrupted multi-byte options
  • Loading branch information...
2 parents bfc1f6a + b141a47 commit 6bdecc8f56a06f085b4444dc29361a5aa80d9eef @gitster gitster committed Feb 15, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 parse-options.c
View
@@ -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);
}

0 comments on commit 6bdecc8

Please sign in to comment.