On Sun, Mar 20, 2005 at 12:24:54AM -0800, Michael G Schwern wrote: > On Sat, Mar 19, 2005 at 10:20:59PM -0800, Yitzchak Scott-Thoennes wrote: > > I encountered a problem with quoting when running a cygwin gcc (in > > this case, in "-mno-cygwin" MinGW mode) from a non-cygwin make that > > the following patch would fix, but I've been hesitant to send it to > > you because I don't know what all platforms go through that code, and > > know how likely quoting changes are to mess things up in obscure ways, > > and also because I feel the cygwin behavior is buggy, though unlikely > > to change. But here it is, nevertheless. Maybe if nothing else it > > can be the first patch towards 6.27. > > This smells like its going to break something. Also this code has been > in there for a very long time so I'm not inclined to change it now. > > I'll just wait and see if this turns out to be a Cygwin bug.
It's really a gray area. cygwin aims at providing a linux-like environment, and when one cygwin program starts another, the args are passed in an actual array; it's just when a non-cygwin program starts a cygwin program that the latter needs to perform what's usually the shell's job of breaking up the command line into parameters. For various and sundry reasons, in doing so, it only treats \ as an escape character inside of "", so something like -DXS_VERSION=\"1.04\" has the first \ as literal, and the second used to escape the second " (leaving the opening " unmatched, but there's no way to reject mismatched quotes as a shell would be able to do.) The only possible change I can see would be to not treat the first " as opening a quoted section, since there's no matching ", but the code that does all this is extremely hairy, and I'm really reluctant to try messsing with it. Are you open to trying out the patch *after* 6.26 is out?
