From 91b8a8d1d21b810b6aca44ce647837669efd6dcf Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 21 Jun 2001 09:10:42 +0000 Subject: next_token() was supposed to be a reentrant replacement for strtok(), but the code suffered from bitrot and is not now reentrant. That means we can get bizarre behaviour i've fixed this by making next_token() reentrant and creating a next_token_nr() that is a small non-reentrant wrapper for those lumps of code (mostly smbclient) that have come to rely on the non-reentrant behaviour (This used to be commit 674ee2f1d12b0afc164a9e9072758fd1c5e54df7) --- source3/client/clitar.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/client/clitar.c') diff --git a/source3/client/clitar.c b/source3/client/clitar.c index f6e0423025..3c35e41155 100644 --- a/source3/client/clitar.c +++ b/source3/client/clitar.c @@ -1322,7 +1322,7 @@ void cmd_block(void) fstring buf; int block; - if (!next_token(NULL,buf,NULL,sizeof(buf))) + if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { DEBUG(0, ("blocksize \n")); return; @@ -1346,7 +1346,7 @@ void cmd_tarmode(void) { fstring buf; - while (next_token(NULL,buf,NULL,sizeof(buf))) { + while (next_token_nr(NULL,buf,NULL,sizeof(buf))) { if (strequal(buf, "full")) tar_inc=False; else if (strequal(buf, "inc")) @@ -1392,7 +1392,7 @@ void cmd_setmode(void) attra[0] = attra[1] = 0; - if (!next_token(NULL,buf,NULL,sizeof(buf))) + if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { DEBUG(0, ("setmode <[+|-]rsha>\n")); return; @@ -1401,7 +1401,7 @@ void cmd_setmode(void) safe_strcpy(fname, cur_dir, sizeof(pstring)); safe_strcat(fname, buf, sizeof(pstring)); - while (next_token(NULL,buf,NULL,sizeof(buf))) { + while (next_token_nr(NULL,buf,NULL,sizeof(buf))) { q=buf; while(*q) @@ -1443,7 +1443,7 @@ void cmd_tar(void) char **argl; int argcl; - if (!next_token(NULL,buf,NULL,sizeof(buf))) + if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { DEBUG(0,("tar [IXbgan] \n")); return; -- cgit