Corrected a glitch in the command-line parser. Now commas
authorscottmk <scottmk@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 6 Nov 2009 12:34:34 +0000 (12:34 +0000)
committerscottmk <scottmk@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 6 Nov 2009 12:34:34 +0000 (12:34 +0000)
are treated as the equivalent of white space between
parameters.  For example { "a":5 },{ "b":true } is parsed as
two separate JSON objects, even though there is no white space
between them.

M    src/srfsh/srfsh.c

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1845 9efc2488-bf62-4759-914b-345cdb29e865

src/srfsh/srfsh.c

index ffa15f8..e99d5cc 100644 (file)
@@ -1306,8 +1306,9 @@ static void parse_args( const char* request, osrfStringArray* cmd_array )
        while( !done ) {
                OSRF_BUFFER_RESET( parser.buf );
 
-               // skip any white space
-               while( *parser.itr && isspace( (unsigned char) *parser.itr ) )
+               // skip any white space or commas
+               while( *parser.itr
+                          && ( isspace( (unsigned char) *parser.itr ) || ',' == *parser.itr ) )
                        ++parser.itr;
 
                if( '\0' == *parser.itr )