From a28a95c11a5d5103df539df4dc5a12cdb9405b03 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Fri, 28 Jul 2006 12:23:18 +0000 Subject: [PATCH] MFH: patch for #37846 (wordwrap() wraps incorrectly) by Dmitry Kononov --- NEWS | 1 + ext/standard/string.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index db286a189e..5f9c10d7b7 100644 --- 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) diff --git a/ext/standard/string.c b/ext/standard/string.c index 2eacd3ead0..6ab8e008c0 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -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; } } -- 2.50.1