Skip to content

Commit

Permalink
Merge branch 'ef/non-ascii-parse-options-error-diag' into maint
Browse files Browse the repository at this point in the history
* ef/non-ascii-parse-options-error-diag:
  parse-options: report uncorrupted multi-byte options
  • Loading branch information
Junio C Hamano committed Feb 27, 2013
2 parents 28db111 + b141a47 commit 6f0c336
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion parse-options.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 6f0c336

Please sign in to comment.