From: Tim Potter Date: Fri, 4 May 2001 01:04:23 +0000 (+0000) Subject: Allow ctrl-d to exit rpcclient. X-Git-Tag: samba-2.2.5pre1~2087^2~114 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=37cdf37fee8414183c4ecb49e68a468ad235787d;p=thirdparty%2Fsamba.git Allow ctrl-d to exit rpcclient. Don't try to run anything if user just presses return at rpcclient prompt. --- diff --git a/source/rpcclient/rpcclient.c b/source/rpcclient/rpcclient.c index d50510212ef..787545173be 100644 --- a/source/rpcclient/rpcclient.c +++ b/source/rpcclient/rpcclient.c @@ -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; +}