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 Windows 7, AFAIU because quoted "*" is still
> expanded by the globbing code in test-system-quote-child.exe:
> 
>   for input = |*|: system() command failed with status 3: 
> .\test-system-quote-child.exe "*"
>   for input = |*|: popen() command failed with status 3: 
> .\test-system-quote-child.exe "*"
>   for input = |*|: CreateProcess() command failed with status 3: 
> .\test-system-quote-child.exe "*"
>   for input = |*|: system() command failed with status 3: 
> .\test-system-quote-child.exe "*"
>   for input = |*|: popen() command failed with status 3: 
> .\test-system-quote-child.exe "*"
>   FAIL: test-system-quote.sh

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.

Any idea what gnulib can do against it?

The only thing I can see is to modify the source code of all programs:
Change

  int
  main (int argc, char *argv[])
  {

to

  int
  main (int argc, char *argv[])
  {
    argv = RESTORE_PROGRAM_ARGV (argv);

where gnulib would define a macro RESTORE_PROGRAM_ARGV like this:

#ifdef WINDOWS_NATIVE
# define RESTORE_PROGRAM_ARGV(argv) parse_and_split (GetCommandLine ())
#else
# define RESTORE_PROGRAM_ARGV(argv) argv
#endif

But such source code modifications are obviously heavy. Do you see
something simpler?

Bruno


Reply via email to