Skip to content

Commit 8e411fe

Browse files
committed
Revert "Merge branch 'sse2_strtolower' of https://github.com/laruence/php-src"
This reverts commit 5a6373f, reversing changes made to 45cb421. This breaks strtolower-win32.phpt.
1 parent 0b04b93 commit 8e411fe

File tree

1 file changed

+18
-22
lines changed

1 file changed

+18
-22
lines changed

ext/standard/string.c

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,33 +1462,29 @@ PHPAPI zend_string *php_string_tolower(zend_string *s)
14621462
unsigned char *c;
14631463
const unsigned char *e;
14641464

1465-
if (EXPECTED(!BG(locale_changed))) {
1466-
return zend_string_tolower(s);
1467-
} else {
1468-
c = (unsigned char *)ZSTR_VAL(s);
1469-
e = c + ZSTR_LEN(s);
1465+
c = (unsigned char *)ZSTR_VAL(s);
1466+
e = c + ZSTR_LEN(s);
14701467

1471-
while (c < e) {
1472-
if (isupper(*c)) {
1473-
register unsigned char *r;
1474-
zend_string *res = zend_string_alloc(ZSTR_LEN(s), 0);
1468+
while (c < e) {
1469+
if (isupper(*c)) {
1470+
register unsigned char *r;
1471+
zend_string *res = zend_string_alloc(ZSTR_LEN(s), 0);
14751472

1476-
if (c != (unsigned char*)ZSTR_VAL(s)) {
1477-
memcpy(ZSTR_VAL(res), ZSTR_VAL(s), c - (unsigned char*)ZSTR_VAL(s));
1478-
}
1479-
r = c + (ZSTR_VAL(res) - ZSTR_VAL(s));
1480-
while (c < e) {
1481-
*r = tolower(*c);
1482-
r++;
1483-
c++;
1484-
}
1485-
*r = '\0';
1486-
return res;
1473+
if (c != (unsigned char*)ZSTR_VAL(s)) {
1474+
memcpy(ZSTR_VAL(res), ZSTR_VAL(s), c - (unsigned char*)ZSTR_VAL(s));
14871475
}
1488-
c++;
1476+
r = c + (ZSTR_VAL(res) - ZSTR_VAL(s));
1477+
while (c < e) {
1478+
*r = tolower(*c);
1479+
r++;
1480+
c++;
1481+
}
1482+
*r = '\0';
1483+
return res;
14891484
}
1490-
return zend_string_copy(s);
1485+
c++;
14911486
}
1487+
return zend_string_copy(s);
14921488
}
14931489
/* }}} */
14941490

0 commit comments

Comments
 (0)