summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2001-05-04 01:04:23 +0000
committerTim Potter <tpot@samba.org>2001-05-04 01:04:23 +0000
commit1bbc3d193bb86c4b1d4877237437eb7d6eb78b57 (patch)
tree0adba1c1eeb9af165ed9a733c01fa85693965a11 /source3
parent401b3cc7a7a4994df073e6435a60ad7f22ae62e4 (diff)
downloadsamba-1bbc3d193bb86c4b1d4877237437eb7d6eb78b57.tar.gz
samba-1bbc3d193bb86c4b1d4877237437eb7d6eb78b57.tar.bz2
samba-1bbc3d193bb86c4b1d4877237437eb7d6eb78b57.zip
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)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpcclient/rpcclient.c11
1 files changed, 7 insertions, 4 deletions
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;
+}