added line to remove trailing ';'
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Tue, 8 Mar 2005 15:50:12 +0000 (15:50 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Tue, 8 Mar 2005 15:50:12 +0000 (15:50 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@203 9efc2488-bf62-4759-914b-345cdb29e865

src/srfsh/srfsh.c

index c231cd3..126ff2a 100644 (file)
@@ -279,6 +279,9 @@ int handle_request( char* words[], int relay ) {
                        buffer = buffer_init(128);
                        buffer_add(buffer, "[");
                        for(i = 3; words[i] != NULL; i++ ) {
+                               /* removes trailing semicolon if user accidentally enters it */
+                               if( words[i][strlen(words[i])-1] == ';' )
+                                       words[i][strlen(words[i])-1] = '\0';
                                buffer_add( buffer, words[i] );
                                buffer_add(buffer, " ");
                        }