cvs: php4(PHP_4_2_0) /ext/standard string.c

From: Date: Mon, 24 Jun 2002 08:19:44 +0000
Subject: cvs: php4(PHP_4_2_0) /ext/standard string.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-12482@lists.php.net to get a copy of this message
derick Mon Jun 24 04:19:44 2002 EDT Modified files: (Branch: PHP_4_2_0) /php4/ext/standard string.c Log: - MFH Index: php4/ext/standard/string.c diff -u php4/ext/standard/string.c:1.263.2.5 php4/ext/standard/string.c:1.263.2.6 --- php4/ext/standard/string.c:1.263.2.5 Thu May 16 10:53:12 2002 +++ php4/ext/standard/string.c Mon Jun 24 04:19:43 2002 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: string.c,v 1.263.2.5 2002/05/16 14:53:12 rasmus Exp $ */ +/* $Id: string.c,v 1.263.2.6 2002/06/24 08:19:43 derick Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -1811,7 +1811,7 @@ convert_to_string_ex(str); if (!Z_STRLEN_PP(str)) { - RETURN_FALSE; + RETURN_EMPTY_STRING(); } ZVAL_STRINGL(return_value, Z_STRVAL_PP(str), Z_STRLEN_PP(str), 1); @@ -1832,7 +1832,7 @@ convert_to_string_ex(str); if (!Z_STRLEN_PP(str)) { - RETURN_FALSE; + RETURN_EMPTY_STRING(); } ZVAL_STRINGL(return_value, Z_STRVAL_PP(str), Z_STRLEN_PP(str), 1); @@ -2118,7 +2118,6 @@ { char *s, *t; int l; - char escape_char='\\'; if (len != NULL) { l = *len; @@ -2137,8 +2136,16 @@ (*len)--; l--; } - } - *s++ = *t++; + *s++ = *t++; + } else if (*t=='\\' && l>0 && t[1]=='0') { + *s++='\0'; + t += 2; + if (len != NULL) + (*len)--; + l--; + } else { + *s++ = *t++; + } l--; } *s = '\0'; @@ -2148,7 +2155,7 @@ while (l > 0) { - if (*t == escape_char) { + if (*t == '\\') { t++; /* skip the slash */ if (len != NULL) (*len)--;

« previous php.cvs (#12482) next »