]> granicus.if.org Git - php/commitdiff
(ucwords) Fixed fix for fix for fix for #4748.
authorJouni Ahto <jah@php.net>
Thu, 1 Jun 2000 13:38:23 +0000 (13:38 +0000)
committerJouni Ahto <jah@php.net>
Thu, 1 Jun 2000 13:38:23 +0000 (13:38 +0000)
# Today's most fixed bug.

ext/standard/string.c

index 62c95f168965d5c4f8df39e667226fe1593b8d3a..77b0a3949b8c48a64935ca6210c977c3aea61443 100644 (file)
@@ -1153,9 +1153,11 @@ PHP_FUNCTION(ucwords)
 
        r=return_value->value.str.val;
        *r=toupper((unsigned char)*r);
-       for(r_end = r + return_value->value.str.len -1 ; r < r_end ; r++ ) {
+       for(r_end = r + return_value->value.str.len -1 ; r < r_end ; ) {
                if(isspace(*r)) {
-                       *++r=toupper((unsigned char)*r);
+                       *r=toupper((unsigned char)*++r);
+               } else {
+                       r++;
                }
        }
 }