iliaa Thu May 13 13:44:33 2004 EDT Added files: (Branch: PHP_4_3) /php-src/ext/standard/tests/strings bug28386.phpt
Modified files: /php-src/ext/standard string.c /php-src NEWS Log: MFH: Fixed bug #28386 (wordwrap() wraps lines 1 character too soon). http://cvs.php.net/diff.php/php-src/ext/standard/string.c?r1=1.333.2.38&r2=1.333.2.39&ty=u Index: php-src/ext/standard/string.c diff -u php-src/ext/standard/string.c:1.333.2.38 php-src/ext/standard/string.c:1.333.2.39 --- php-src/ext/standard/string.c:1.333.2.38 Mon Dec 1 18:21:25 2003 +++ php-src/ext/standard/string.c Thu May 13 13:44:32 2004 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: string.c,v 1.333.2.38 2003/12/01 23:21:25 iliaa Exp $ */ +/* $Id: string.c,v 1.333.2.39 2004/05/13 17:44:32 iliaa Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -658,7 +658,7 @@ } else if (text[current] == ' ') { if (current - laststart >= linelength) { newtext[current] = breakchar[0]; - laststart = current; + laststart = current + 1; } lastspace = current; } else if (current - laststart >= linelength && laststart != lastspace) { http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1247.2.660&r2=1.1247.2.661&ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1247.2.660 php-src/NEWS:1.1247.2.661 --- php-src/NEWS:1.1247.2.660 Wed May 12 12:49:55 2004 +++ php-src/NEWS Thu May 13 13:44:33 2004 @@ -10,6 +10,7 @@ with multiple result sets returned. (Frank) - Fixed logic bug in session_register() which allowed registering _SESSION and/or HTTP_SESSION_VARS. (Sara) +- Fixed bug #28386 (wordwrap() wraps lines 1 character too soon). (Ilia) - Fixed bug #28374 (Possible unterminated loop inside _php_pgsql_trim_message()). (Ilia) - Fixed bug #28355 (glob() does not return error on Linux when it does not http://cvs.php.net/co.php/php-src/ext/standard/tests/strings/bug28386.phpt?r=1.1&p=1 Index: php-src/ext/standard/tests/strings/bug28386.phpt +++ php-src/ext/standard/tests/strings/bug28386.phpt --TEST-- Bug #28386 (wordwrap() wraps text 1 character too soon) --FILE-- <?php $text = "Some text"; $string = "$text $text $text $text"; echo wordwrap($string, 9); ?> --EXPECT-- Some text Some text Some text Some text -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php