Re: new module 'system-quote'

2012-05-10 Thread Eli Zaretskii
> From: Bruno Haible > Cc: bug-gnulib@gnu.org > Date: Fri, 11 May 2012 01:42:20 +0200 > > expected: ??? > received: sys > expected: > received: sys > expected: ? > received: sys > for input = |???|: CreateProcess() command failed with status 1: > .\test-system-quote-child.exe ??? > for

Re: new module 'system-quote'

2012-05-10 Thread Eli Zaretskii
> From: Bruno Haible > Cc: bug-gnulib@gnu.org > Date: Fri, 11 May 2012 01:58:02 +0200 > > > If I'm not missing anything, I submit that '*' should be removed from > > the list of special characters. Leaving it there means that it will > > be impossible to invoke programs with arguments that inclu

Re: new module 'system-quote'

2012-05-10 Thread Eli Zaretskii
> From: Bruno Haible > Cc: bug-gnulib@gnu.org > Date: Fri, 11 May 2012 02:08:43 +0200 > > Thanks a lot for doing this testing. Yes, it is consistent with what you > said: The wildcard expansion between GetCommandLine() and argv has been > changed to consider '*' inside double-quotes as a wildcard

Re: new module 'system-quote'

2012-05-10 Thread Bruno Haible
Eli Zaretskii wrote: > > $ ./configure (with the appropriate options for mingw, depending on your > > environment) > > $ make > > $ make check > > or (for just the single test) > > $ cd gltests > > $ make check TESTS=test-system-quote.sh > > As expected, it fails on Wi

Re: new module 'system-quote'

2012-05-10 Thread Bruno Haible
Paul Eggert wrote: > In the context of 'diff' we don't want "*" to be a wildcard; > we want it to be just a literal "*". Your statement holds not only in the context of 'diff', but also in the context of any program that uses gnulib. Because gnulib is about implementing POSIX semantics on weird sy

Re: new module 'system-quote'

2012-05-10 Thread Bruno Haible
Hi Eli, > > If you want to see what happens, just remove the '*' from > > SHELL_SPECIAL_CHARS and re-run the unit test. > > I see this: > > for input = |*|: CreateProcess() command failed with status 3: > .\test-system-quote-child.exe * > > But IIUC that just means we hit this condition in t

Re: new module 'system-quote'

2012-05-10 Thread Bruno Haible
I replied to Eli: > Eli Zaretskii wrote: > > > The test suite of the module 'system-quote' reveals that the '*' is also > > > special for CreateProcess on Windows and needs to be escaped > > > > What about '?'? Should we quote it as well? > > The statements that I have in the unit test > >

Re: new module 'system-quote'

2012-05-10 Thread Bruno Haible
Bastien ROUCARIES wrote: > Or cmd /v:on but it will work only with xp and latter > > ok we should use delayed expansion but we should in this case escape ! > > try cmd /v /c printf "%s\n" foo!CR!bar' | od -t x1 Delayed expansion is not enabled by default, AFAICS. And system() and popen() don't p

Re: new module 'system-quote'

2012-05-10 Thread Eli Zaretskii
> Date: Thu, 10 May 2012 09:28:38 -0700 > From: Paul Eggert > CC: Bruno Haible , bug-gnulib@gnu.org > > On 05/10/2012 09:20 AM, Eli Zaretskii wrote: > > If I'm not missing anything, I submit that '*' should be removed from > > the list of special characters. Leaving it there means that it will >

Re: new module 'system-quote'

2012-05-10 Thread Paul Eggert
On 05/10/2012 09:20 AM, Eli Zaretskii wrote: > If I'm not missing anything, I submit that '*' should be removed from > the list of special characters. Leaving it there means that it will > be impossible to invoke programs with arguments that include > wildcards. In the context of 'diff' we don't

Re: new module 'system-quote'

2012-05-10 Thread Eli Zaretskii
> From: Bruno Haible > Cc: bug-gnulib@gnu.org > Date: Thu, 10 May 2012 11:29:17 +0200 > > > > If I recall it correctly, the > > > check_one (interpreter, prog, "*"); > > > case failed: Apparently, when you pass a single unquoted '*' argument > > > to CreateProcess, it can fail with GetLastError

Re: new module 'system-quote'

2012-05-10 Thread Eli Zaretskii
> From: Bruno Haible > Cc: bug-gnulib@gnu.org > Date: Thu, 10 May 2012 00:35:08 +0200 > > $ ./configure (with the appropriate options for mingw, depending on your > environment) > $ make > $ make check > or (for just the single test) > $ cd gltests > $ make check TEST

Re: use of __STDC_VERSION__ > foo in config.h

2012-05-10 Thread Paul Eggert
The general idea that config.h should work with -Wundef is OK but I see a couple of problems with the proposed patch. First, the logic is wrong, as it assumes that when __STDC_VERSION__ is not defined then the compiler supports C

Re: new module 'system-quote'

2012-05-10 Thread Bastien ROUCARIES
Or cmd /v:on but it will work only with xp and latter ok we should use delayed expansion but we should in this case escape ! try cmd /v /c printf "%s\n" foo!CR!bar' | od -t x1 see http://stackoverflow.com/a/4095133 for order of extension On Thu, May 10, 2012 at 2:06 PM, Bruno Haible wrote: >

Re: new module 'system-quote'

2012-05-10 Thread Bruno Haible
Bastien ROUCARIES wrote: > Something like this > > ^^^%NL%%NL%^%NL%%CR% No, this does not work either. $ export NL=' ' $ eval `echo "export CR='_'" | tr '_' '\r'` $ echo "$NL" | od -t x1 000 0a 0a 002 $ echo "$CR" | od -t x1 000 0d 0a 002 $ cmd.exe /c 'printf "%s\n" foo^%NL%

Re: new module 'system-quote'

2012-05-10 Thread Bruno Haible
Hi Paul, > > shell_quote_argv and system_quote_argv are essentially the same > > function, differing only in that one invokes > > shell_quote_length/shell_quote_copy and the other calls > > system_quote_length/system_quote_copy. Perhaps they should be > > refactored into calling a single function

RE : Re: new module 'system-quote'

2012-05-10 Thread Bastien ROUCARIES
No you need to escape new one the cr Something like this ^^^%NL%%NL%^%NL%%CR% Bastien Le 10 mai 2012 00:41, "Eric Blake" a écrit : On 05/09/2012 04:08 PM, Bruno Haible wrote: > Bastien ROUCARIES wrote: >> Something like this will w... If I understood that page, the magic sequence is '^-newlin

RE : Re: new module 'system-quote'

2012-05-10 Thread Bastien ROUCARIES
echo line1^ line2 Work also and could be simple Maybe echo line1^ \rline2 Will work with \r a not escaped carriage return Le 10 mai 2012 00:07, "Bruno Haible" a écrit : Bastien ROUCARIES wrote: > Something like this will work > http://stackoverflow.com/a/269819 Indeed! It allows to substitu

Re: new module 'system-quote'

2012-05-10 Thread Bruno Haible
Eli, > > If I recall it correctly, the > > check_one (interpreter, prog, "*"); > > case failed: Apparently, when you pass a single unquoted '*' argument > > to CreateProcess, it can fail with GetLastError() = ERROR_PATH_NOT_FOUND. > > That is expected and reasonable: the first token in the argu