[PHP-DEV] CVS update: php31/ext/standard From: shane (php-dev <email protected>)
Date: 09/30/98

Date: Wednesday September 30, 1998 @ 0:01
Author: shane

Update of /repository/php31/ext/standard
In directory asf:/u2/tmp/cvs-serv17795/ext/standard

Modified Files:
        string.c
Log Message:
reworking makefiles, still in progress.
strtok fix added.

Index: php31/ext/standard/string.c
diff -c php31/ext/standard/string.c:2.3 php31/ext/standard/string.c:2.4
*** php31/ext/standard/string.c:2.3 Thu Sep 10 20:22:46 1998
--- php31/ext/standard/string.c Wed Sep 30 00:01:41 1998
***************
*** 30,36 ****
   */
  
  
! /* $Id: string.c,v 2.3 1998/09/11 00:22:46 zeev Exp $ */
  #ifdef THREAD_SAFE
  #include "tls.h"
  #endif
--- 30,36 ----
   */
  
  
! /* $Id: string.c,v 2.4 1998/09/30 04:01:41 shane Exp $ */
  #ifdef THREAD_SAFE
  #include "tls.h"
  #endif
***************
*** 302,308 ****
          static char *strtok_pos1 = NULL;
          static char *strtok_pos2 = NULL;
  #endif
! char *token = NULL;
          char *first = NULL;
          int argc;
          TLS_VARS;
--- 302,308 ----
          static char *strtok_pos1 = NULL;
          static char *strtok_pos2 = NULL;
  #endif
! char *token = NULL, *tokp=NULL;
          char *first = NULL;
          int argc;
          TLS_VARS;
***************
*** 315,321 ****
                  WRONG_PARAM_COUNT;
          }
          convert_to_string(tok);
! token = tok->value.str.val;
  
          if (argc == 2) {
                  convert_to_string(str);
--- 315,321 ----
                  WRONG_PARAM_COUNT;
          }
          convert_to_string(tok);
! tokp = token = tok->value.str.val;
  
          if (argc == 2) {
                  convert_to_string(str);
***************
*** 337,342 ****
--- 337,349 ----
                          *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 <email protected>
For help: php-dev-help <email protected>