Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 6f0c336

Browse files
committed
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
2 parents 28db111 + b141a47 commit 6f0c336

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

parse-options.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,11 @@ int parse_options(int argc, const char **argv, const char *prefix,
471471
default: /* PARSE_OPT_UNKNOWN */
472472
if (ctx.argv[0][1] == '-') {
473473
error("unknown option `%s'", ctx.argv[0] + 2);
474-
} else {
474+
} else if (isascii(*ctx.opt)) {
475475
error("unknown switch `%c'", *ctx.opt);
476+
} else {
477+
error("unknown non-ascii option in string: `%s'",
478+
ctx.argv[0]);
476479
}
477480
usage_with_options(usagestr, options);
478481
}

0 commit comments

Comments
 (0)