patch: remove unneeded strlen() check from php_addcslashes

From: Date: Tue, 12 Dec 2006 19:31:28 +0000
Subject: patch: remove unneeded strlen() check from php_addcslashes
Groups: php.internals 
Request: Send a blank email to internals+get-26923@lists.php.net to get a copy of this message
Hi, The strlen() check on line 4730 of ext/standard/string.c is pointless because of the length assignment in line 4720. Below is a patch (against latest 5.2) to remove them. Regards, Ron Korving Index: ext/standard/string.c =================================================================== RCS file: /repository/php-src/ext/standard/string.c,v retrieving revision 1.621 diff -u -r1.621 string.c --- ext/standard/string.c 12 Dec 2006 18:17:56 -0000 1.621 +++ ext/standard/string.c 12 Dec 2006 19:26:40 -0000 @@ -4727,10 +4727,6 @@ wlength = strlen(what); } - if (!length) { - length = strlen(str); - } - php_charmask((unsigned char*)what, wlength, flags TSRMLS_CC); for (source = str, end = source + length, target = new_str; (c = *source) || (source < end); source++) {

« previous php.internals (#26923) next »