[Opensrf-commits] r1845 - trunk/src/srfsh (scottmk)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Nov 6 07:34:35 EST 2009


Author: scottmk
Date: 2009-11-06 07:34:34 -0500 (Fri, 06 Nov 2009)
New Revision: 1845

Modified:
   trunk/src/srfsh/srfsh.c
Log:
Corrected a glitch in the command-line parser.  Now commas
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


Modified: trunk/src/srfsh/srfsh.c
===================================================================
--- trunk/src/srfsh/srfsh.c	2009-11-05 21:03:36 UTC (rev 1844)
+++ trunk/src/srfsh/srfsh.c	2009-11-06 12:34:34 UTC (rev 1845)
@@ -1306,8 +1306,9 @@
 	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 )



More information about the opensrf-commits mailing list