we don't add 'newlines' to history.
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 4 Mar 2005 22:09:53 +0000 (22:09 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 4 Mar 2005 22:09:53 +0000 (22:09 +0000)
we make sure children exit after finishing so the shell doesn't get forked

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

src/srfsh/srfsh.c

index 5c2bec1..2ba214d 100644 (file)
@@ -89,7 +89,9 @@ int main( int argc, char* argv[] ) {
                char* req_copy = strdup(request);
 
                parse_request( req_copy ); 
-               add_history(request);
+               if( request && strlen(request) > 2 ) {
+                       add_history(request);
+               }
 
                free(request);
                free(req_copy);
@@ -280,6 +282,7 @@ int handle_exec(char* words[]) {
                }
        } else {
                execvp( words[0], words );
+               exit(0);
        }
        return 1;
 }