summaryrefslogtreecommitdiff
path: root/ext/standard/string.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2014-02-18 17:42:46 +0800
committerXinchen Hui <laruence@gmail.com>2014-02-18 17:42:46 +0800
commit43b03c74b322d6ceb003a14a7561fdffc4e13072 (patch)
treee5cf8ec9939d559fc7f6aaedb89404d2312561cc /ext/standard/string.c
parent1c4f3d39a805323dc60f2bc1bfc96e39d608ac37 (diff)
downloadphp-git-43b03c74b322d6ceb003a14a7561fdffc4e13072.tar.gz
Refacting smart_str
Diffstat (limited to 'ext/standard/string.c')
-rw-r--r--ext/standard/string.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 76815def26..5fff869bce 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -1201,9 +1201,8 @@ PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value TSRMLS_DC)
}
smart_str_0(&implstr);
- if (implstr.len) {
-//??? RETURN_STRINGL(implstr.c, implstr.len, 0);
- RETURN_STRINGL(implstr.c, implstr.len);
+ if (implstr.s) {
+ RETURN_STR(implstr.s);
} else {
smart_str_free(&implstr);
RETURN_EMPTY_STRING();
@@ -3069,10 +3068,9 @@ end_outer_loop: ;
smart_str_appendl(&result, &S(text)[nextwpos], L(text) - nextwpos);
- if (result.c != NULL) {
+ if (result.s) {
smart_str_0(&result);
-//??? RETVAL_STRINGL(result.c, result.len, 0);
- RETVAL_STRINGL(result.c, result.len);
+ RETURN_STR(result.s);
} else {
RETURN_EMPTY_STRING();
}