On Mon, Jan 24, 2005 at 01:37:38PM +0000, Angus Leeming wrote: > Jean-Marc Lasgouttes wrote: > > What I was not sure about is how you handle option=='foo bar'. > > We don't. All hell breaks loose at this point and always has. The existing > code to split a string up into an argv array is: : [snip] : > Ie, we assume that ' ' marks the gap between arguments in the string. To do > this properly requires a fully-formed parser of the sh language.
I just ran a quick test. Any Unix shell treats "--option='foo bar'" as a single element of "*argv[]". The single-quotes protected the space from the shell. (I tested with bash, ash, csh, tcsh, ksh, and bsh.) For Windows, however I wouldn't be surprised if whitespace chars weren't escaped. Just another one of those platform differences that'll need special handling. -- John Weiss