Rocco Rutte:
authorpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Fri, 9 Sep 2005 01:21:38 +0000 (01:21 +0000)
committerpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Fri, 9 Sep 2005 01:21:38 +0000 (01:21 +0000)
- for f=f with DelSp, handle empty lines correctly after removing 1 trailing WS (thanks to Daniel Vrcic <daniel.vrcic@si.htnet.hr> for giving details)

git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@497 e385b8ad-14ed-0310-8656-cc95a2468c6d

VERSION.svn
rfc3676.c

index 39efca7..1303c35 100644 (file)
@@ -1 +1 @@
-496
+497
index 9b626ce..650fc50 100644 (file)
--- a/rfc3676.c
+++ b/rfc3676.c
@@ -68,7 +68,7 @@ static void print_flowed_line (char *line, STATE * s, int ql) {
   }
 
   if (str_len (line) == 0) {
-    if (option (OPTQUOTEEMPTY)) {
+    if (!(s->flags & M_REPLYING) || option (OPTQUOTEEMPTY)) {
       if (s->prefix)
         state_puts(s->prefix,s);
       for (i=0;i<ql;++i) state_putc('>',s);
@@ -192,6 +192,15 @@ int rfc3676_handler (BODY * a, STATE * s) {
     if (delsp && buf_len >= 1 && buf[buf_len-1] == ' ')
       buf[--buf_len] = '\0';
 
+    /* we're here when last space removed 'cause of DelSp was
+     * the last space and there isn't more -> done */
+    if ((buf_len - buf_off) < 0) {
+      print_flowed_line (curline, s, quotelevel);
+      *curline = '\0';
+      curline_len = 1;
+      continue;
+    }
+
     /* signature separator also flushes the previous paragraph */
     if (strcmp(buf + buf_off, "-- ") == 0 && curline && *curline) {
       print_flowed_line (curline, s, quotelevel);