[Top][All Lists]

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

Re: Make CVS (Win32) improperly leaves batch files with -n

From: Eli Zaretskii
Subject: Re: Make CVS (Win32) improperly leaves batch files with -n
Date: Fri, 17 Feb 2006 21:50:01 +0200

> From: "J. David Bryan" <address@hidden>
> Date: Fri, 17 Feb 2006 11:35:31 -0500
> CC: address@hidden
> Thank you for the explanation.  However, it appears that cmd.exe actually 
> doesn't mind the extra quotes.  I tried this from cmd.exe under both NT 4.0 
> and XP:
>   mkdir "b c"
>   echo Hello from subdir > "b c\msg.txt"
>   cmd /c "cd "b c" && type msg.txt"
> ...and "Hello from subdir" appeared.

Yes, I know about that.  But you see, Make's code doesn't know about
special quoting rules of CMD, it _does_ think that an embedded quote
needs to be escaped.  And that's what I was trying to explain: doing
this without batch files brings additional complications in the code
that generates the command line to be passed to the programs invoked
by Make.

> My initial tests seem to indicate, though, that the command that would be 
> written to the batch file could be passed directly to cmd.exe instead, 
> without alteration.  So, unless there's some pathological case that I'm not 
> grasping, batch files could be bypassed, and the shell could be invoked 
> directly for cmd.exe.
> I'll investigate a patch for this, if you think that it's a reasonable 
> change.

By all means, give it a try.  Just be sure to test all the special
constructs, like redirection and pipes, wildcards, () grouping, ^
escapes, etc.  Also, make sure you test with external programs as part
of the command line, not only cmd internal commands, because the
startup code of the Microsoft runtime has its own ideas about quoting.

reply via email to

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