1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-12 12:23:50 +03:00

Fix restart after length count.

Jeremy.
This commit is contained in:
Jeremy Allison
2007-11-30 14:15:34 -08:00
parent 09e01a4716
commit fa8115f32b

View File

@@ -92,6 +92,7 @@ static bool next_token_internal_talloc(TALLOC_CTX *ctx,
bool ltrim) bool ltrim)
{ {
char *s; char *s;
char *saved_s;
char *pbuf; char *pbuf;
bool quoted; bool quoted;
size_t len=1; size_t len=1;
@@ -116,9 +117,12 @@ static bool next_token_internal_talloc(TALLOC_CTX *ctx,
/* nothing left? */ /* nothing left? */
if (!*s) { if (!*s) {
return(false); return false;
} }
/* When restarting we need to go from here. */
saved_s = s;
/* Work out the length needed. */ /* Work out the length needed. */
for (quoted = false; *s && for (quoted = false; *s &&
(quoted || !strchr_m(sep,*s)); s++) { (quoted || !strchr_m(sep,*s)); s++) {
@@ -137,6 +141,7 @@ static bool next_token_internal_talloc(TALLOC_CTX *ctx,
/* copy over the token */ /* copy over the token */
pbuf = *pp_buff; pbuf = *pp_buff;
s = saved_s;
for (quoted = false; *s && for (quoted = false; *s &&
(quoted || !strchr_m(sep,*s)); s++) { (quoted || !strchr_m(sep,*s)); s++) {
if ( *s == '\"' ) { if ( *s == '\"' ) {