cvs: php4(PHP_4_0_7) /ext/standard string.c

From: Date: Tue, 13 Nov 2001 00:00:18 +0000
Subject: cvs: php4(PHP_4_0_7) /ext/standard string.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-8164@lists.php.net to get a copy of this message
jmoore Mon Nov 12 19:00:18 2001 EDT Modified files: (Branch: PHP_4_0_7) /php4/ext/standard string.c Log: MFH Index: php4/ext/standard/string.c diff -u php4/ext/standard/string.c:1.224.2.2 php4/ext/standard/string.c:1.224.2.3 --- php4/ext/standard/string.c:1.224.2.2 Sat Nov 10 18:49:53 2001 +++ php4/ext/standard/string.c Mon Nov 12 19:00:18 2001 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: string.c,v 1.224.2.2 2001/11/10 23:49:53 andrei Exp $ */ +/* $Id: string.c,v 1.224.2.3 2001/11/13 00:00:18 jmoore Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -907,6 +907,7 @@ char *token_end; char *p; char *pe; + int skipped = 0; if (ZEND_NUM_ARGS() < 1 || ZEND_NUM_ARGS() > 2 || zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE) @@ -947,12 +948,15 @@ /* Skip leading delimiters */ while (STRTOK_TABLE(p)) + { if (++p >= pe) { /* no other chars left */ BG(strtok_last) = NULL; RETVAL_FALSE; goto restore; } + skipped++; + } /* We know at this place that *p is no delimiter, so skip it */ while (++p < pe) @@ -961,7 +965,7 @@ if (p - BG(strtok_last)) { return_token: - RETVAL_STRINGL(BG(strtok_last), p - BG(strtok_last), 1); + RETVAL_STRINGL(BG(strtok_last) + skipped, (p - BG(strtok_last)) - skipped, 1); BG(strtok_last) = p + 1; } else { RETVAL_FALSE;

« previous php.cvs (#8164) next »