[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Caret escaping

From: Alessandro Vesely
Subject: Re: Caret escaping
Date: Thu, 05 Jan 2006 12:22:05 +0100
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)

Markus Mauhart wrote:
%% Alessandro Vesely <address@hidden> writes:

av> Thus, in case the "slow path" is taken, the LINE command should be replaced 
av>   SHELL may be either a unixy_shell, cmd.exe or the old,
av>   FLAG should be -c for unixy_shell or /C otherwise, and
av>   ESCAPED-LINE should be escaped using backslashes for unixy_shell,
av>     carets for cmd.exe, or
av>     no escape at all for the old command.exe.
av> Then there is a batch_mode_shell flag, which is usually set for cmd.exe
av> and causes a NOT-SO-ESCAPED-LINE to be written to a temporary batch file.
av> Should we revise those specs in order to make a smarter use of cmd.exe?

I just checked it out (VC - built make381beta4 with above patches applied)
and it turns out that ^-escaping breaks my makefiles (not using -j):
make381beta4.exe now creates a batch file which 2nd line starts with ...

    (^"C:/Program Files/msvs71/Common7/Tools/vsvars32.bat^" > nul) && cl
> [...]
So AFAICS this part of the jobs-patch is wrong:

    >  . use '^' to escape special characters such as \ and " in job.c

Thanks for the test. You proved that making a smarter use of cmd.exe is
not strightforward. cmd.exe /C LINE does not require LINE to be a single
argument, i.e. double quotes around LINE are not needed.

The special characters are &<>()@^| thus \ and " should not be escaped.

The following command works as intended from the command line:

 start cmd.exe /C "("C:/Program Files/msvs71/Common7/Tools/vsvars32.bat" > nul)" 
^&^& cl

Thus, the escaping logic used by cmd.exe is not consistent with Unix,
and there is no code in make that would produce the above escaping.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]