]> granicus.if.org Git - php/commitdiff
ucwords will now test against isspace() instead of just ==" "
authorHartmut Holzgraefe <hholzgra@php.net>
Thu, 1 Jun 2000 09:56:54 +0000 (09:56 +0000)
committerHartmut Holzgraefe <hholzgra@php.net>
Thu, 1 Jun 2000 09:56:54 +0000 (09:56 +0000)
(see BUG #4748)

ext/standard/string.c

index faabe4c702f5cf61a209636cd7ebb58860b3e853..c46b8817e3aee34cb26fcb22738da47b686f9913 100644 (file)
@@ -1155,12 +1155,14 @@ PHP_FUNCTION(ucwords)
 
        r=return_value->value.str.val;
        r_end = r + (*str)->value.str.len;
-       while((r=php_memnstr(r, " ", 1, r_end)) != NULL){
-               if(r < r_end){
-                       r++;
-                       *r=toupper((unsigned char)*r);
-               } else {
-                       break;
+       while(++r<r_end){
+               if(isspace(*r)) {
+                       if(r < r_end){
+                               r++;
+                               *r=toupper((unsigned char)*r);
+                       } else {
+                               break;
+                       }
                }
        }
 }