]> granicus.if.org Git - php/commitdiff
Fix trim("a") bug.
authorAndrei Zmievski <andrei@php.net>
Tue, 18 Apr 2006 02:40:29 +0000 (02:40 +0000)
committerAndrei Zmievski <andrei@php.net>
Tue, 18 Apr 2006 02:40:29 +0000 (02:40 +0000)
ext/standard/string.c

index 0eebf40276244210612cc8344f1f72a129eb112b..82761e81864e729b42d80dca4214a7842b8e0b9c 100644 (file)
@@ -724,9 +724,7 @@ static UChar *php_u_trim(UChar *c, int len, UChar *what, int what_len, zval *ret
                                if ( u_isWhitespace(ch) == FALSE ) break;
                        }
                }
-               if ( i < end ) {
-                       U16_BACK_1(c, 0, i); /* U16_NEXT() post-increments 'i' */
-               }
+               U16_BACK_1(c, 0, i); /* U16_NEXT() post-increments 'i' */
                start = i;
        }
        if ( mode & 2 ) {