CVS update: php3/functions
| From: | shane | Date: | Wed, 30 Sep 1998 03:52:25 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-1558@lists.php.net to get a copy of this message | ||
Date: Tuesday September 29, 1998 @ 23:52
Author: shane
Update of /repository/php3/functions
In directory asf:/u2/tmp/cvs-serv17720/functions
Modified Files:
string.c
Log Message:
Fix for bug #800
Index: php3/functions/string.c
diff -c php3/functions/string.c:1.140 php3/functions/string.c:1.141
*** php3/functions/string.c:1.140 Fri Sep 18 12:55:10 1998
--- php3/functions/string.c Tue Sep 29 23:52:21 1998
***************
*** 30,36 ****
*/
! /* $Id: string.c,v 1.140 1998/09/18 16:55:10 rasmus Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
#endif
--- 30,36 ----
*/
! /* $Id: string.c,v 1.141 1998/09/30 03:52:21 shane Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
#endif
***************
*** 306,312 ****
static char *strtok_pos1 = NULL;
static char *strtok_pos2 = NULL;
#endif
! char *token = NULL;
char *first = NULL;
int argc;
TLS_VARS;
--- 306,312 ----
static char *strtok_pos1 = NULL;
static char *strtok_pos2 = NULL;
#endif
! char *token = NULL, *tokp=NULL;
char *first = NULL;
int argc;
TLS_VARS;
***************
*** 319,325 ****
WRONG_PARAM_COUNT;
}
convert_to_string(tok);
! token = tok->value.str.val;
if (argc == 2) {
convert_to_string(str);
--- 319,325 ----
WRONG_PARAM_COUNT;
}
convert_to_string(tok);
! tokp = token = tok->value.str.val;
if (argc == 2) {
convert_to_string(str);
***************
*** 336,346 ****
--- 336,354 ----
first = STATIC(strtok_pos2);
}
} /* NB: token is unusable now */
+
STATIC(strtok_pos2) = first;
if (STATIC(strtok_pos2)) {
*STATIC(strtok_pos2) = '\0';
}
RETVAL_STRING(STATIC(strtok_pos1),1);
+
+ /* skip 'token' white space for next call to strtok */
+ while (STATIC(strtok_pos2) &&
+ strchr(tokp, *(STATIC(strtok_pos2)+1))) {
+ STATIC(strtok_pos2)++;
+ }
+
if (STATIC(strtok_pos2))
STATIC(strtok_pos1) = STATIC(strtok_pos2) + 1;
else
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net