From 888d2e2f11bfd3d69b9075882d85f27729619ea5 Mon Sep 17 00:00:00 2001 From: Keith Marshall Date: Wed, 25 Jan 2017 13:07:06 +0000 Subject: [PATCH] Use C99 blanks as default argv separators, per issue [#2329]. --- mingwrt/ChangeLog | 10 ++++++++++ mingwrt/setargv.c | 8 +++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog index e285d3c..d827abc 100644 --- a/mingwrt/ChangeLog +++ b/mingwrt/ChangeLog @@ -1,3 +1,13 @@ +2017-01-25 Keith Marshall + + 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 Correct preprocessor logic; fix bug [#2322] diff --git a/mingwrt/setargv.c b/mingwrt/setargv.c index 09e543c..73bb8dd 100644 --- a/mingwrt/setargv.c +++ b/mingwrt/setargv.c @@ -8,7 +8,7 @@ * $Id$ * * Written by Keith Marshall - * Copyright (C) 2014, MinGW.org Project + * Copyright (C) 2014, 2017, MinGW.org Project * * --------------------------------------------------------------------------- * @@ -33,6 +33,8 @@ * --------------------------------------------------------------------------- * */ +#define _ISOC99_SOURCE + #include #include #include @@ -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)... -- 2.11.0