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: Sat, 12 May 2012 11:31 +0200
User-agent: KMail/4.7.4 (Linux/3.1.10-1.9-desktop; KDE/4.7.4; x86_64; ; )

Eli Zaretskii wrote:
> If programs need to call 'glob' before calling 'system' and 'popen'
> with arguments quoted by this module, that fact should be prominently
> mentioned in the documentation.

The programmer needs to invoke glob explicitly if he uses the system-quote
module *and* wants wildcard expansion. I'm adding a bit of comments to
make this clear.

But since gnulib doesn't override system() nor popen(), there is nothing
to document for these functions.

Feel free to provide a doc patch if I misunderstood what you meant.

Bruno


2012-05-12  Bruno Haible  <address@hidden>

        sh-quote, system-quote: Add comments about wildcards.
        * lib/sh-quote.h: Clarify what happens with wildcard characters.
        * lib/system-quote.h: Likewise.
        Reported by Eli Zaretskii <address@hidden>.

--- lib/sh-quote.h.orig Sat May 12 11:23:38 2012
+++ lib/sh-quote.h      Sat May 12 11:20:47 2012
@@ -20,7 +20,7 @@
 
 /* When passing a command to a shell, we must quote the program name and
    arguments, since Unix shells interpret characters like " ", "'", "<", ">",
-   "$" etc. in a special way.  */
+   "$", '*', '?' etc. in a special way.  */
 
 #include <stddef.h>
 
--- lib/system-quote.h.orig     Sat May 12 11:23:38 2012
+++ lib/system-quote.h  Sat May 12 11:23:25 2012
@@ -20,14 +20,16 @@
 
 /* When passing a command the system's command interpreter, we must quote the
    program name and arguments, since
-     - Unix shells interpret characters like " ", "'", "<", ">", "$" etc. in a
-       special way,
+     - Unix shells interpret characters like " ", "'", "<", ">", "$", '*', '?'
+       etc. in a special way,
      - Windows CreateProcess() interprets characters like ' ', '\t', '\\', '"'
        etc. (but not '<' and '>') in a special way,
      - Windows cmd.exe also interprets characters like '<', '>', '&', '%', etc.
        in a special way.  Note that it is impossible to pass arguments that
        contain newlines or carriage return characters to programs through
-       cmd.exe.  */
+       cmd.exe.
+     - Windows programs usually perform wildcard expansion when they receive
+       arguments that contain unquoted '*', '?' characters.  */
 
 #include <stddef.h>
 




reply via email to

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