tony2001 Tue Oct 2 11:35:26 2007 UTC
Modified files:
/php-src/ext/standard string.c
Log:
make strcspn() behave the same way in both Unicode and native mode (bug
#42731)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.653&r2=1.654&diff_format=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.653 php-src/ext/standard/string.c:1.654
--- php-src/ext/standard/string.c:1.653 Mon Oct 1 13:41:57 2007
+++ php-src/ext/standard/string.c Tue Oct 2 11:35:26 2007
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: string.c,v 1.653 2007/10/01 13:41:57 jani Exp $ */
+/* $Id: string.c,v 1.654 2007/10/02 11:35:26 tony2001 Exp $ */
/* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
@@ -2306,7 +2306,11 @@
for (i = 0, codepts = 0 ; i < len1 ; ) {
U16_NEXT(s1, i, len1, ch);
- if (!len2 || u_memchr32(s2, ch, len2)) {
+ if (len2) {
+ if (u_memchr32(s2, ch, len2)) {
+ break;
+ }
+ } else if (ch == (UChar32)0x00){
break;
}
codepts++;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php