[PATCH 2/2] cmd: Handle truncation for console reads

Frédéric Delanoy frederic.delanoy at gmail.com
Sat Oct 1 04:43:07 CDT 2011

2011/10/1 Dan Kegel <dank at kegel.com>:
> What's motivating this change?  Are you quite sure you know how
> ReadConsole behaves?
> I bet one could write a test for this that used SendInput to
> send keystrokes to be read by ReadConsole, and
> verify the end of line and end of buffer behavior...

Motivation for this change is a verification/fix of the current
truncation reporting/handling.
I checked with debugger and various parameters (including changing
noChars/MAXSTRING) and it's how it currently behaves.

Error messages for truncation are already done in wcmdmain.c around line 1840

    /* Handle truncated input - issue warning */
    if (strlenW(extraSpace) == MAXSTRING -1) {

Now cmd just outputs a warning but continues on truncated input (don't
know if windows does the same)

More information about the wine-devel mailing list