From ec27006ebeef24375dd59c2b952ce98ca8e40084 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 18 Mar 2013 14:53:00 -0400
Subject: [PATCH] Fix wrapping of text lines with the same length as specified length limit
---
program/lib/Roundcube/rcube_mime.php | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/program/lib/Roundcube/rcube_mime.php b/program/lib/Roundcube/rcube_mime.php
index 2f24a1b..d21e3b4 100644
--- a/program/lib/Roundcube/rcube_mime.php
+++ b/program/lib/Roundcube/rcube_mime.php
@@ -595,11 +595,12 @@
while (count($list)) {
$line = array_shift($list);
$l = mb_strlen($line);
- $newlen = $len + $l + ($len ? 1 : 0);
+ $space = $len ? 1 : 0;
+ $newlen = $len + $l + $space;
if ($newlen <= $width) {
- $string .= ($len ? ' ' : '').$line;
- $len += (1 + $l);
+ $string .= ($space ? ' ' : '').$line;
+ $len += ($space + $l);
}
else {
if ($l > $width) {
--
Gitblit v1.9.1