iliaa Thu May 13 13:44:23 2004 EDT Added files: /php-src/ext/standard/tests/strings bug28386.phpt
Modified files: /php-src/ext/standard string.c Log: Fixed bug #28386 (wordwrap() wraps lines 1 character too soon). http://cvs.php.net/diff.php/php-src/ext/standard/string.c?r1=1.415&r2=1.416&ty=u Index: php-src/ext/standard/string.c diff -u php-src/ext/standard/string.c:1.415 php-src/ext/standard/string.c:1.416 --- php-src/ext/standard/string.c:1.415 Thu May 6 12:11:50 2004 +++ php-src/ext/standard/string.c Thu May 13 13:44:23 2004 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: string.c,v 1.415 2004/05/06 16:11:50 jay Exp $ */ +/* $Id: string.c,v 1.416 2004/05/13 17:44:23 iliaa Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -661,7 +661,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/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