summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-11-30 14:15:34 -0800
committerJeremy Allison <jra@samba.org>2007-11-30 14:15:34 -0800
commitd1807be93c44b5140f07de7e3c272afc65e5c08b (patch)
tree957d1eb907eae4e0a3e5d7eefa112c4eadd2e04c
parentcfbbeebbc6d8c6197e277c7edaeec14f4ac3ef93 (diff)
downloadsamba-d1807be93c44b5140f07de7e3c272afc65e5c08b.tar.gz
samba-d1807be93c44b5140f07de7e3c272afc65e5c08b.tar.bz2
samba-d1807be93c44b5140f07de7e3c272afc65e5c08b.zip
Fix restart after length count.
Jeremy. (This used to be commit fa8115f32bfd37f75c284ff0f6906dbc2af0f40c)
-rw-r--r--source3/lib/util_str.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index 886ae2a043..a0ca03a972 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -92,6 +92,7 @@ static bool next_token_internal_talloc(TALLOC_CTX *ctx,
bool ltrim)
{
char *s;
+ char *saved_s;
char *pbuf;
bool quoted;
size_t len=1;
@@ -116,9 +117,12 @@ static bool next_token_internal_talloc(TALLOC_CTX *ctx,
/* nothing left? */
if (!*s) {
- return(false);
+ return false;
}
+ /* When restarting we need to go from here. */
+ saved_s = s;
+
/* Work out the length needed. */
for (quoted = false; *s &&
(quoted || !strchr_m(sep,*s)); s++) {
@@ -137,6 +141,7 @@ static bool next_token_internal_talloc(TALLOC_CTX *ctx,
/* copy over the token */
pbuf = *pp_buff;
+ s = saved_s;
for (quoted = false; *s &&
(quoted || !strchr_m(sep,*s)); s++) {
if ( *s == '\"' ) {