TCmdLineParser: the error for an unclosed quote or a trailing - contains a...
Brought to you by:
twm
When the command line ends where the parser still expects a character, the states report Format(_('Invalid character "%s".'), [c]) with c = #0, the end marker that GetNextChar returns. The message then contains a NUL character.
This happens for:
TEngineStateQuotedExe, TEngineStateQuotedParam, TEngineStateQuotedShortParam, TEngineStateQuotedLongParam), e.g. prog "abc- or -- at the very end of the command line (TEngineStateDash, TEngineStateDoubleDash), e.g. prog -TGetOpt passes the message on as ECmdLineSyntax, and TDefaultMain shows it in the usage. Anything that hands the text over as a PChar, such as MessageBox, stops at the NUL and shows only Invalid character ".
Expected: a message that says what is wrong, e.g. Missing closing quote. and Option name expected after "-".
Found by a code review of [features:#37].
Fixed in revision [r2494].
Related
Commit: [r2494]