[Top][All Lists]

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

Re: new module 'system-quote'

From: Eli Zaretskii
Subject: Re: new module 'system-quote'
Date: Wed, 09 May 2012 08:41:18 +0300

> From: Bruno Haible <address@hidden>
> Cc: address@hidden
> Date: Wed, 09 May 2012 03:43:22 +0200
> 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?

Btw, the issue of quoting wildcard characters is tricky, because it
changes the semantics of the argument wrt to wildcard expansion.  What
if an argument includes both special characters, like whitespace,
_and_ wildcards?

It gets worse, see below.

> otherwise CreateProcess may fail (at least on Windows XP).

Failures should be avoided, of course.  However, it might be a good
idea to add a warning to the commentary, to the effect that wildcard
characters ? and * _cannot_ be protected from expansions on Windows
Vista and later.  According to this:


MS modified their implementation of command-line globbing in versions
of MSVCRT starting with those systems, such that the wildcards are
expanded even if they are inside quotes.

This thread on the MinGW list:


indicates that MinGW in some future version will probably invoke its
own globbing code instead, so at least MinGW programs will soon be
exempt from this terrible misfeature.  But other programs, and in
particularly those supplied as part of Windows or compiled with the MS
compilers, cannot benefit from MinGW workarounds.  So I think a caveat
is in order here, because sooner or later people will bump into this
and will be mightily surprised.

reply via email to

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