[Bug 18057] New: mishandled has_space==1 && opt_s==0 in programs/wcmdmain.c for built in commands

wine-bugs at winehq.org wine-bugs at winehq.org
Tue Apr 14 18:08:38 CDT 2009


           Summary: mishandled has_space==1 && opt_s==0 in
                    programs/wcmdmain.c for built in commands
           Product: Wine
           Version: 1.1.19
          Platform: Other
        OS/Version: other
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: programs
        AssignedTo: wine-bugs at winehq.org
        ReportedBy: swelef at post.sk

When using ActivePerl to execute Perl statements such as
    my $p=`set PATH`;
ActivePerl will pass it as a quoted argument to CreateProcessW:
    CreateProcessW app L"cmd.exe" cmdline L"cmd.exe /x/d/c \"set PATH\""
wcmdmain.c:wmain will get the following arguments:
    0 => L"cmd.exe"
    1 => L"/x/d/c"
    2 => L"set PATH"
and determine that has_space==1 && opt_s==0 thus creating
    cmd = L"\"set PATH\""
This command is later passed to WCMD_execute where there's no match with
the "inbuilt[]" commands (because of the leading double-quote) and it's in
turn passed to WCMD_run_program. That function tries to do its best but in
    if ((opt_c || opt_k) && !opt_s && !status
        && GetLastError()==ERROR_FILE_NOT_FOUND && command[0]=='\"')
branch (wcmdmain.c, lines #1158-1162 in wine 1.1.19) it strips the quotes
and calls _itself_ thus missing the check for "inbuilt[]" commands. What's
required here is to call back to WCMD_execute but unfortunately some of
the WCMD_execute's arguments are not available at this point.

PS: I'm trying to use S60_5th_Edition_SDK_v1.0 on debian lenny and the
first point of failure was the Perl statement
    open PIPE, "set EPOCROOT |";
I have made experiments with wine 1.0.1 and 1.1.19 and with ActivePerl and StrawberryPerl with the same results. However,
Wine 1.1.19 with ActivePerl and `set PATH` is the only test case I have
investigated in depth.

Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
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