]> granicus.if.org Git - php/commitdiff
MFH: patch for #37846 (wordwrap() wraps incorrectly)
authorAntony Dovgal <tony2001@php.net>
Fri, 28 Jul 2006 12:23:18 +0000 (12:23 +0000)
committerAntony Dovgal <tony2001@php.net>
Fri, 28 Jul 2006 12:23:18 +0000 (12:23 +0000)
by Dmitry Kononov <ddk at krasn dot ru>

NEWS
ext/standard/string.c

diff --git a/NEWS b/NEWS
index db286a189e1d88bdc5fabaa93ad87b8ca002b628..5f9c10d7b7fa1c86a8383272c95f3b77e48efc1a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -36,6 +36,7 @@ PHP                                                                        NEWS
   names). (Ilia)
 - Fixed bug #38047 ("file" and "line" sometimes not set in backtrace from
   inside error handler). (Dmitry)
+- Fixed bug #37846 (wordwrap() wraps incorrectly). (ddk at krasn dot ru, Tony)
 - Fixed bug #37564 (AES privacy encryption not possible due to net-snmp 5.2
   compatibility issue). (Jani, patch by scott dot moynes+php at gmail dot com)
 
index 2eacd3ead0eec4dcea23573e4fa7efe89c7feeef..6ab8e008c0693d79cd0b88a99f1285ef59b246f2 100644 (file)
@@ -669,7 +669,7 @@ PHP_FUNCTION(wordwrap)
                                lastspace = current;
                        } else if (current - laststart >= linelength && laststart != lastspace) {
                                newtext[lastspace] = breakchar[0];
-                               laststart = lastspace;
+                               laststart = lastspace + 1;
                        }
                }