diff options
author | Tim Potter <tpot@samba.org> | 2001-05-04 01:04:23 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2001-05-04 01:04:23 +0000 |
commit | 37cdf37fee8414183c4ecb49e68a468ad235787d (patch) | |
tree | 78fdd444be90061f28d45f3c5861ef500b3e07f6 | |
parent | 1e7b1c71b9c409859bcf0aeb3d5785acc4aee027 (diff) | |
download | samba-37cdf37fee8414183c4ecb49e68a468ad235787d.tar.gz samba-37cdf37fee8414183c4ecb49e68a468ad235787d.tar.xz samba-37cdf37fee8414183c4ecb49e68a468ad235787d.zip |
Allow ctrl-d to exit rpcclient.
Don't try to run anything if user just presses return at rpcclient prompt.
-rw-r--r-- | source/rpcclient/rpcclient.c | 11 |
1 files changed, 7 insertions, 4 deletions
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; +} |