summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorRasmus Lerdorf <rasmus@php.net>2000-06-07 00:59:14 +0000
committerRasmus Lerdorf <rasmus@php.net>2000-06-07 00:59:14 +0000
commitff843bacf445c185be292a32c8078a72a6e11c53 (patch)
tree7cc699daae775a14a37f4b33e4649eec7971ccb7 /ext
parent0ebcdb28afcb94d2c9258c06c609b474ed73b4bf (diff)
downloadphp-git-ff843bacf445c185be292a32c8078a72a6e11c53.tar.gz
Make trim strip \0 to match php 3
@ Make trim strip \0 to match php 3 (Rasmus)
Diffstat (limited to 'ext')
-rw-r--r--ext/standard/string.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c
index cd68ac1116..9b49744065 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -133,7 +133,7 @@ PHPAPI void php_trim(zval *str, zval * return_value, int mode)
if (mode & 1) {
for (i = 0; i < len; i++) {
if (c[i] == ' ' || c[i] == '\n' || c[i] == '\r' ||
- c[i] == '\t' || c[i] == '\v') {
+ c[i] == '\t' || c[i] == '\v' || c[i] == '\0') {
trimmed++;
} else {
break;
@@ -145,7 +145,7 @@ PHPAPI void php_trim(zval *str, zval * return_value, int mode)
if (mode & 2) {
for (i = len - 1; i >= 0; i--) {
if (c[i] == ' ' || c[i] == '\n' || c[i] == '\r' ||
- c[i] == '\t' || c[i] == '\v') {
+ c[i] == '\t' || c[i] == '\v' || c[i] == '\0') {
len--;
} else {
break;