bug-gnulib
[Top][All Lists]
Advanced

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

Re: new module 'system-quote'


From: Bruno Haible
Subject: Re: new module 'system-quote'
Date: Fri, 11 May 2012 02:08:43 +0200
User-agent: KMail/4.7.4 (Linux/3.1.10-1.9-desktop; KDE/4.7.4; x86_64; ; )

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

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