]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
Allow whitespace-only lines to end wrapping.
authorBen Schmidt <none@none>
Wed, 29 Feb 2012 06:39:28 +0000 (17:39 +1100)
committerBen Schmidt <none@none>
Wed, 29 Feb 2012 06:39:28 +0000 (17:39 +1100)
README.listtexts
src/prepstdreply.c

index 68717d1142b8b51ebb2cf2b442eccdfdeebb8353..f030a425af0c15d61216e01508f9b68a25a60e66 100644 (file)
@@ -251,11 +251,12 @@ Wrapping needs to be enabled for each paragraph with:
 
 - %wrap%
 - %wrap W%
-  concatenate and rewrap lines until the next blank line to a width of W (or 76
-  if W is omitted); second and later lines are preceded with as many spaces as
-  the width preceding the directive; the width is reckoned including any text
-  preceding the directive and any indentation preserved from a file which
-  included the current one, so it is an absolute maximum width
+  concatenate and rewrap lines until the next empty or whitespace-only line to
+  a width of W (or 76 if W is omitted); second and later lines are preceded
+  with as many spaces as the width preceding the directive; the width is
+  reckoned including any text preceding the directive and any indentation
+  preserved from a file which included the current one, so it is an absolute
+  maximum width
 
 To cater for various languages, there are a number of different wrapping modes
 that can be set. These can be set either before or after wrapping is specified,
index 13a9517a18d2f3fbe3d3e93db2093f0436f66ca8..a5e2c70e603db12c4624597da5beadef45186122 100644 (file)
@@ -1207,9 +1207,11 @@ char *get_processed_text_line(text *txt, int headers,
                        }
                        pos++;
                        *pos = '\0';
-                       if (*line == '\r' || *line == '\n' || *line == '\0') {
-                               /* Blank line; stop wrapping, finish
-                                  the last line and save the blank
+                       pos = line;
+                       while (*pos == ' ' || *pos == '\t') pos++;
+                       if (*pos == '\r' || *pos == '\n' || *pos == '\0') {
+                               /* Empty/white line; stop wrapping, finish
+                                  the last line and save the empty/white
                                   line for later. */
                                txt->wrapwidth = 0;
                                txt->src->upcoming = line;
@@ -1219,12 +1221,6 @@ char *get_processed_text_line(text *txt, int headers,
                                pos = line + len;
                                skipwhite = 0;
                        } else {
-                               pos = line;
-                               while (*pos == ' ' || *pos == '\t') pos++;
-                               if (*pos == '\0') {
-                                       myfree(line);
-                                       continue;
-                               }
                                if (*prev == '\0') {
                                        tmp = mystrdup(pos);
                                } else {