OSDN Git Service

Suppress glob-brace expansion within quoted arguments.
authorKeith Marshall <keith@users.osdn.me>
Mon, 16 Apr 2018 14:53:36 +0000 (15:53 +0100)
committerKeith Marshall <keith@users.osdn.me>
Mon, 16 Apr 2018 14:53:36 +0000 (15:53 +0100)
mingwrt/ChangeLog
mingwrt/setargv.c

index e108893..fe327f1 100644 (file)
@@ -1,5 +1,12 @@
 2018-04-16  Keith Marshall  <keith@users.osdn.me>
 
+       Suppress glob-brace expansion within quoted arguments.
+
+       * setargv.c (__mingw32_setargv) [quoted]: Handle '{', ',', and '}'
+       in the same manner as '*', and '?'.
+
+2018-04-16  Keith Marshall  <keith@users.osdn.me>
+
        Suppress glob-brace expansion of single item lists.
 
        * mingwex/glob.c (glob_match) [c == '{']: Look-ahead to matching '}';
index 1b57f85..3ac119d 100644 (file)
@@ -8,7 +8,7 @@
  * $Id$
  *
  * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
- * Copyright (C) 2014, 2017, MinGW.org Project
+ * Copyright (C) 2014, 2017, 2018, MinGW.org Project
  *
  * ---------------------------------------------------------------------------
  *
@@ -143,9 +143,14 @@ void __mingw32_setargv( const char *cmdline )
         */
        bracket = (_CRT_glob & ARGV_NOGROUP) ? 0 : ARGV_NOGROUP;
 
-      case '*':
-      case '?':
-       /* These standard globbing tokens...
+      case '*': case '?':
+       /* These standard globbing tokens,...
+        */
+      case '{': case ',': case '}':
+       /* ...this additional triplet, non-standard, but required
+        * to support GNU's GLOB_BRACE extension; (strictly we need
+        * to consider these only if GLOB_BRACE is enabled, but it
+        * should do no harm to consider them regardless),...
         */
       case ARGV_ESCAPE:
        /* ...and the escape character itself, need to be escaped