parse-options: report uncorrupted multi-byte options
authorErik Faye-Lund <kusmabite@gmail.com>
Mon, 11 Feb 2013 23:13:48 +0000 (00:13 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 11 Feb 2013 23:19:30 +0000 (15:19 -0800)
commitb141a47801d6fb2d68ec48adfe7597ec3ce49c0d
tree70d3a883efb6842ffef0e2496f3b900e6283efc7
parent901fd180c9d19025bafefc34e131125628169bdd
parse-options: report uncorrupted multi-byte options

Because our command-line parser considers only one byte at the time
for short-options, we incorrectly report only the first byte when
multi-byte input was provided. This makes user-errors slightly
awkward to diagnose for instance under UTF-8 locale and non-English
keyboard layouts.

Report the whole argument-string when a non-ASCII short-option is
detected.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Improved-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
parse-options.c