]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
Ensure we don't wrap prematurely and insert an unwanted blank line.
authorBen Schmidt <none@none>
Mon, 19 Mar 2012 23:43:01 +0000 (10:43 +1100)
committerBen Schmidt <none@none>
Mon, 19 Mar 2012 23:43:01 +0000 (10:43 +1100)
This could happen when the space was inserted between lines: it could trigger
wrapping before there was actually an overflow.

src/prepstdreply.c

index d9e5df612476481a73bc6a7cab98fe9213af170c..26ea541b00414500cd50b0cf82a683dc408853ea 100644 (file)
@@ -1273,7 +1273,8 @@ char *get_processed_text_line(text *txt, int headers,
                inhibitbreak = 0;
                while (*pos != '\0') {
                        if (txt->wrapwidth != 0 && width >= txt->wrapwidth &&
-                                       !peeking && linebreak > wrapindentlen)
+                                       !peeking && linebreak > wrapindentlen &&
+                                       linebreak < len)
                                        break;
                        if ((unsigned char)*pos > 0xbf && txt->skip == NULL &&
                                        txt->wrapmode == WRAP_CHAR &&
@@ -1458,7 +1459,8 @@ char *get_processed_text_line(text *txt, int headers,
 
                if (txt->wrapwidth != 0 && !peeking) {
                        if (width < txt->wrapwidth ||
-                                       linebreak <= wrapindentlen) {
+                                       linebreak <= wrapindentlen ||
+                                       linebreak >= len) {
                                prev = line;
                                continue;
                        }