From 1bbc3d193bb86c4b1d4877237437eb7d6eb78b57 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Fri, 4 May 2001 01:04:23 +0000 Subject: Allow ctrl-d to exit rpcclient. Don't try to run anything if user just presses return at rpcclient prompt. (This used to be commit 37cdf37fee8414183c4ecb49e68a468ad235787d) --- source3/rpcclient/rpcclient.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'source3/rpcclient') diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c index d50510212e..787545173b 100644 --- a/source3/rpcclient/rpcclient.c +++ b/source3/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; +} -- cgit