]> granicus.if.org Git - php/commitdiff
Fixed bug #49361 (wordwrap() wraps incorrectly on end of line boundaries).
authorIlia Alshanetsky <iliaa@php.net>
Mon, 31 Aug 2009 12:28:46 +0000 (12:28 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 31 Aug 2009 12:28:46 +0000 (12:28 +0000)
ext/standard/string.c

index f28c284f3c2d58812bb49c2b0092aae892ebf40a..50a54defb9ade236910a66d4b6f2795737a08ecf 100644 (file)
@@ -1034,7 +1034,7 @@ PHP_FUNCTION(wordwrap)
                laststart = lastspace = 0;
                for (current = 0; current < textlen; current++) {
                        if (text[current] == breakchar[0]) {
-                               laststart = lastspace = current;
+                               laststart = lastspace = current + 1;
                        } else if (text[current] == ' ') {
                                if (current - laststart >= linelength) {
                                        newtext[current] = breakchar[0];