From 5152a76ba011489dcf6b848e5b244319b6942a5f Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 12 May 2012 11:25:17 +0200 Subject: [PATCH] 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 . --- ChangeLog | 7 +++++++ lib/sh-quote.h | 2 +- lib/system-quote.h | 8 +++++--- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 805ebb7c2..c92156ca9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-05-12 Bruno Haible + + 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 . + 2012-05-11 Paul Eggert fsusage: check for GNU/Linux statvfs problem dynamically diff --git a/lib/sh-quote.h b/lib/sh-quote.h index 12c3dd3c2..50956d070 100644 --- a/lib/sh-quote.h +++ b/lib/sh-quote.h @@ -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 diff --git a/lib/system-quote.h b/lib/system-quote.h index d5f29780b..48d59efaa 100644 --- a/lib/system-quote.h +++ b/lib/system-quote.h @@ -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 -- 2.11.0