summaryrefslogtreecommitdiff
path: root/source3/lib/cmd_interp.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-06-21 09:10:42 +0000
committerAndrew Tridgell <tridge@samba.org>2001-06-21 09:10:42 +0000
commit91b8a8d1d21b810b6aca44ce647837669efd6dcf (patch)
tree2490cec37a9ae7f9f9ad9adabac033b41e26c07b /source3/lib/cmd_interp.c
parent4ff011d88ef5b79b92d2cea1abe32c93bc03f724 (diff)
downloadsamba-91b8a8d1d21b810b6aca44ce647837669efd6dcf.tar.gz
samba-91b8a8d1d21b810b6aca44ce647837669efd6dcf.tar.bz2
samba-91b8a8d1d21b810b6aca44ce647837669efd6dcf.zip
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)
Diffstat (limited to 'source3/lib/cmd_interp.c')
-rw-r--r--source3/lib/cmd_interp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/lib/cmd_interp.c b/source3/lib/cmd_interp.c
index 7934dd0ce9..20812d3f9a 100644
--- a/source3/lib/cmd_interp.c
+++ b/source3/lib/cmd_interp.c
@@ -292,14 +292,14 @@ static BOOL get_cmd_args(char *line)
cmd_argv = NULL;
/* get the first part of the command */
- if (!next_token(&ptr, tok, NULL, sizeof(tok)))
+ if (!next_token_nr(&ptr, tok, NULL, sizeof(tok)))
return False;
do
{
add_chars_to_array(&cmd_argc, &cmd_argv, tok);
}
- while (next_token(NULL, tok, NULL, sizeof(tok)));
+ while (next_token_nr(NULL, tok, NULL, sizeof(tok)));
add_chars_to_array(&cmd_argc, &cmd_argv, NULL);