longer then the original string).
them sort based on the current locale. (Derick)
- Fixed bug #32538 (ext/swf/swf.c does not compile with gcc-3.4.x or newer).
(adam dot greenfield at gmail dot com)
+- Fixed bug #32530 (chunk_split() does not append endstr if chunklen is
+ longer then the original string). (Ilia)
31 Mar 2005, Version 4.3.11
- Added Oracle Instant Client support. (cjbj at hotmail dot com, Tony)
}
if (chunklen > Z_STRLEN_PP(p_str)) {
- RETURN_STRINGL(Z_STRVAL_PP(p_str), Z_STRLEN_PP(p_str), 1);
+ /* to maintain BC, we must return original string + ending */
+ result_len = endlen + Z_STRLEN_PP(p_str);
+ result = emalloc(result_len + 1);
+ memcpy(result, Z_STRVAL_PP(p_str), Z_STRLEN_PP(p_str));
+ memcpy(result + Z_STRLEN_PP(p_str), end, endlen);
+ result[result_len] = '\0';
+ RETURN_STRINGL(result, result_len, 0);
}
if (!Z_STRLEN_PP(p_str)) {
echo chunk_split('abc', 1, '-')."\n";
echo chunk_split('foooooooooooooooo', 5)."\n";
echo chunk_split(str_repeat('X', 2*76))."\n";
+echo chunk_split("test", 10, "|end") . "\n";
?>
--EXPECT--
a-b-c-
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+
+test|end