Rocco Rutte:
[apps/madmutt.git] / rfc3676.c
index 7ca8726..69f7fba 100644 (file)
--- a/rfc3676.c
+++ b/rfc3676.c
@@ -52,7 +52,7 @@ static void print_flowed_line (char *line, STATE * s,
 
   if (MaxLineLength > 0) {
     width = MaxLineLength - WrapMargin - ql - 1;
-    if (option (OPTSTUFFQUOTED))
+    if (!(s->flags & M_REPLYING) && option (OPTSTUFFQUOTED))
       --width;
     if (width < 0)
       width = MaxLineLength;
@@ -63,7 +63,7 @@ static void print_flowed_line (char *line, STATE * s,
     else
       width = COLS - WrapMargin - ql - 1;
 
-    if (option (OPTSTUFFQUOTED))
+    if (!(s->flags & M_REPLYING) && option (OPTSTUFFQUOTED))
       --width;
     if (width < 0)
       width = COLS;
@@ -74,7 +74,7 @@ static void print_flowed_line (char *line, STATE * s,
       if (s->prefix)
         state_puts(s->prefix,s);
       for (i=0;i<ql;++i) state_putc('>',s);
-      if (option(OPTSTUFFQUOTED))
+      if (!(s->flags & M_REPLYING) && option(OPTSTUFFQUOTED))
         state_putc(' ',s);
     }
     state_putc('\n',s);
@@ -123,7 +123,8 @@ static void print_flowed_line (char *line, STATE * s,
 
     for (i = 0; i < ql; ++i)
       state_putc ('>', s);
-    if (option (OPTSTUFFQUOTED) && (ql > 0 || s->prefix))
+    if (!(s->flags & M_REPLYING) && option (OPTSTUFFQUOTED) &&
+        (ql > 0 || s->prefix))
       state_putc (' ', s);
 
     if (delsp && spaces && space_len > 0) {
@@ -240,42 +241,6 @@ int rfc3676_handler (BODY * a, STATE * s) {
   return (0);
 }
 
-void rfc3676_quote_line (STATE* s, char* dst, size_t dstlen,
-                         const char* line) {
-  char quote[SHORT_STRING];
-  int offset = 0, i = 0, count = 0;
-  regmatch_t pmatch[1];
-
-  quote[0] = '\0';
-
-  while (regexec ((regex_t *) QuoteRegexp.rx, &line[offset],
-                  1, pmatch, 0) == 0)
-    offset += pmatch->rm_eo;
-
-  if (offset > 0) {
-    /* first count number of real quoting characters;
-     * read: non-spaces
-     * this maybe just plain wrong, but leaving spaces
-     * within quoting characters is what I consider
-     * more plain wrong...
-     */
-    for (i = 0; i < offset; i++)
-      if (line[i] != ' ')
-        count++;
-    /* just make sure we're inside quote althoug we
-     * likely won't have more than SHORT_STRING quote levels... */
-    i = (count > SHORT_STRING-1) ? SHORT_STRING-1 : count;
-    memset (quote, '>', i);
-    quote[i] = '\0';
-  }
-  debug_print (4, ("f=f: quotelevel = %d, new prefix = '%s'\n",
-                   i, NONULL (quote)));
-  /* if we changed prefix, make sure we respect $stuff_quoted */
-  snprintf (dst, dstlen, "%s%s%s%s", NONULL (s->prefix), NONULL (quote),
-            option (OPTSTUFFQUOTED) && line[offset] != ' ' ? " " : "",
-            &line[offset]);
-}
-
 void rfc3676_space_stuff (HEADER* hdr) {
 #if DEBUG
   int lc = 0;