From b30730b56e06647c826531f3f4e76f5b7cefe2db Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Thu, 24 May 2001 00:31:53 +0000 Subject: Replaced next_command() with call to next_token(). (This used to be commit c9b4ed79c84dde3421c457cd0a33dae5d84fcae1) --- source3/rpcclient/rpcclient.c | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c index 9d2a0de92d8..6258e803bfe 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); } -- cgit