OSDN Git Service

Use C99 blanks as default argv separators, per issue [#2329].
authorKeith Marshall <keithmarshall@users.sourceforge.net>
Wed, 25 Jan 2017 13:07:06 +0000 (13:07 +0000)
committerKeith Marshall <keithmarshall@users.sourceforge.net>
Wed, 25 Jan 2017 13:07:06 +0000 (13:07 +0000)
mingwrt/ChangeLog
mingwrt/setargv.c

index e285d3c..d827abc 100644 (file)
@@ -1,3 +1,13 @@
+2017-01-25  Keith Marshall  <keithmarshall@users.sourceforge.net>
+
+       Use C99 blanks as default argv separators, per issue [#2329].
+
+       * setargv.c [_ISOC99_SOURCE]: Require it.
+       (__mingw32_setargv): Separate command line arguments based on...
+       [(quoted == 0) && isblank( c )]: ...this condition, instead of on...
+       [(quoted == 0) && isspace( c )]: ...this, so that only blanks, rather
+       than any whitespace characters, serve as default argument separators.
+
 2017-01-10  Keith Marshall  <keithmarshall@users.sourceforge.net>
 
        Correct <strings.h> preprocessor logic; fix bug [#2322]
index 09e543c..73bb8dd 100644 (file)
@@ -8,7 +8,7 @@
  * $Id$
  *
  * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
- * Copyright (C) 2014, MinGW.org Project
+ * Copyright (C) 2014, 2017, MinGW.org Project
  *
  * ---------------------------------------------------------------------------
  *
@@ -33,6 +33,8 @@
  * ---------------------------------------------------------------------------
  *
  */
+#define _ISOC99_SOURCE
+
 #include <glob.h>
 #include <string.h>
 #include <ctype.h>
@@ -181,9 +183,9 @@ void __mingw32_setargv( const char *cmdline )
         * literally, after flushing out any pending backslashes.
         */
        argptr = backslash( bslash, argptr );
-       if( (quoted == 0) && isspace( c ) )
+       if( (quoted == 0) && isblank( c ) )
        {
-         /* The one exception is any white space character,
+         /* The one exception is any blank or tab character,
           * when it is not contained within quotes; this acts
           * as an argument separator, (or is simply discarded
           * if there is no argument already collected)...