Replaced next_command() with call to next_token().
authorTim Potter <tpot@samba.org>
Thu, 24 May 2001 00:31:53 +0000 (00:31 +0000)
committerTim Potter <tpot@samba.org>
Thu, 24 May 2001 00:31:53 +0000 (00:31 +0000)
(This used to be commit c9b4ed79c84dde3421c457cd0a33dae5d84fcae1)

source3/rpcclient/rpcclient.c

index 9d2a0de92d8efe7aa4e4e93bc829f30b335fe4cd..6258e803bfed3f03f77a789bb7a7084912d3c314 100644 (file)
@@ -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);
                }