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 22:49:18 +0200
User-agent: KMail/4.7.4 (Linux/3.1.10-1.9-desktop; KDE/4.7.4; x86_64; ; )

Eli Zaretskii wrote:
> I'd suggest something along these lines in the comments:
> 
>   Note that if strings quoted by this module are to be passed to
>   'system' or 'popen' and include wildcards, they need to be processed
>   by 'glob' before quoting, to get the wildcards expanded rather than
>   quoted.
> 
> I believe this is pertinent for Windows and Posix platforms alike.

Yes, we try to write comments that are as widely applicable as possible.
I'm adding this, based on the idea you wrote down:


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

        system-quote: Add more comments.
        * lib/system-quote.h: Add more comments about wilcards and limitations.
        Suggested by Eli Zaretskii <address@hidden>.

--- lib/system-quote.h.orig     Sat May 12 22:45:21 2012
+++ lib/system-quote.h  Sat May 12 22:43:55 2012
@@ -29,7 +29,22 @@
        contain newlines or carriage return characters to programs through
        cmd.exe.
      - Windows programs usually perform wildcard expansion when they receive
-       arguments that contain unquoted '*', '?' characters.  */
+       arguments that contain unquoted '*', '?' characters.
+
+  With this module, you can build a command that will invoke a program with
+  specific strings as arguments.
+
+  Note: If you want wildcard expansion to happen, you have to first do wildcard
+  expansion through the 'glob' module, then quote the resulting strings through
+  this module, and then invoke the system's command interpreter.
+
+  Limitations:
+    - When invoking native Windows programs on Windows Vista or newer,
+      wildcard expansion will occur in the invoked program nevertheless.
+    - On native Windows, for SCI_SYSTEM and SCI_WINDOWS_CMD, newlines and
+      carriage return characters are not supported.  Their undesired effect
+      is to truncate the entire command line.
+ */
 
 #include <stddef.h>
 




reply via email to

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