Allow ctrl-d to exit rpcclient.
authorTim Potter <tpot@samba.org>
Fri, 4 May 2001 01:04:23 +0000 (01:04 +0000)
committerTim Potter <tpot@samba.org>
Fri, 4 May 2001 01:04:23 +0000 (01:04 +0000)
Don't try to run anything if user just presses return at rpcclient prompt.
(This used to be commit 37cdf37fee8414183c4ecb49e68a468ad235787d)

source3/rpcclient/rpcclient.c

index d50510212ef51a6fc4a6f55d41c43cac9e7f2bf5..787545173be3dd7f9929f6c8ec61432ddb5ecc89 100644 (file)
@@ -647,7 +647,6 @@ static void usage(char *pname)
        add_command_set(samr_commands);
        add_command_set(separator_command);
 
-
        /* Do anything specified with -c */
        if (cmdstr[0]) {
                char    *cmd;
@@ -660,7 +659,6 @@ static void usage(char *pname)
                return 0;
        }
 
-
        /* Loop around accepting commands */
        while(1) {
                pstring prompt;
@@ -670,7 +668,12 @@ static void usage(char *pname)
 
                line = smb_readline(prompt, NULL, completion_fn);
 
-               process_cmd(&cli, line);
+               if (line == NULL)
+                       break;
+
+               if (line[0] != '\n')
+                       process_cmd(&cli, line);
        }
-}
 
+       return 0;
+}