[Bug 48449] New: 'CreateProcess(0, "cmd /C [...]' fails when a trailing newline follows a redirect in the cmdline

WineHQ Bugzilla wine-bugs at winehq.org
Sat Jan 11 16:53:50 CST 2020


https://bugs.winehq.org/show_bug.cgi?id=48449

            Bug ID: 48449
           Summary: 'CreateProcess(0, "cmd /C [...]' fails when a trailing
                    newline follows a redirect in the cmdline
           Product: Wine
           Version: 5.0-rc5
          Hardware: x86
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: -unknown
          Assignee: wine-bugs at winehq.org
          Reporter: timotheecisnard at gmail.com
      Distribution: ---

Applications using CreateProcess to invoke "cmd.exe /C" followed by a command,
a redirect to a file, and a newline, result in an "Invalid name" error and the
command not being run. The expected result on Windows is for the trailing
newline to be silently ignored and not treated as part of the file name being
redirected into.

For example, the CreateProcess cmdline "cmd.exe /C echo OK >> test.log\n"
contains a (completely pointless) trailing newline.
Note that the newline is a literal trailing 0x0A character in a cmdline and NOT
an interactive user pressing Enter at a command prompt.

This issue is best reproduced with a 10 line C program:
https://paste.debian.net/1125644/

The bug originally affects ALDEC Active-HDL Lattice Edition 32bit version
10.5.216.6767, where compiling a project works but starting a simulation fails
at the linking step with cryptic errors like "Generation phase ... fail" and
"Error: E8005 : Kernel process initialization failed.".

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list