summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2001-05-24 00:31:53 +0000
committerTim Potter <tpot@samba.org>2001-05-24 00:31:53 +0000
commitb30730b56e06647c826531f3f4e76f5b7cefe2db (patch)
tree98b77dc26e7ea455f893d02b06026b8727ce9231 /source3
parent40ff4007c7ea1c1512592c8a0cb3833be2fe97d1 (diff)
downloadsamba-b30730b56e06647c826531f3f4e76f5b7cefe2db.tar.gz
samba-b30730b56e06647c826531f3f4e76f5b7cefe2db.tar.bz2
samba-b30730b56e06647c826531f3f4e76f5b7cefe2db.zip
Replaced next_command() with call to next_token().
(This used to be commit c9b4ed79c84dde3421c457cd0a33dae5d84fcae1)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpcclient/rpcclient.c26
1 files changed, 5 insertions, 21 deletions
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index 9d2a0de92d..6258e803bf 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -155,25 +155,6 @@ static void read_authfile (
return;
}
-static char* next_command (
- char** cmdstr
-)
-{
- static pstring command;
- char *p;
-
- if (!cmdstr || !(*cmdstr))
- return NULL;
-
- p = strchr(*cmdstr, ';');
- if (p)
- *p = '\0';
- pstrcpy(command, *cmdstr);
- *cmdstr = p;
-
- return command;
-}
-
static void get_username (char *username)
{
if (getenv("USER"))
@@ -664,10 +645,13 @@ static void usage(char *pname)
/* Do anything specified with -c */
if (cmdstr[0]) {
- char *cmd;
+ fstring cmd;
char *p = cmdstr;
- while((cmd=next_command(&p)) != NULL) {
+ DEBUG(0, ("cmdstr = '%s'\n", cmdstr));
+
+ while(next_token(&p, cmd, ";", sizeof(fstring))) {
+ DEBUG(0, ("cmd = '%s'\n", cmd));
process_cmd(&cli, cmd);
}