]> granicus.if.org Git - mutt/commitdiff
Fix a search coloring related bug.
authorThomas Roessler <roessler@does-not-exist.org>
Tue, 17 Nov 1998 09:22:18 +0000 (09:22 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Tue, 17 Nov 1998 09:22:18 +0000 (09:22 +0000)
pager.c
parse.c
pgp.c
postpone.c

diff --git a/pager.c b/pager.c
index c4ea29d9b34a8d1badbe61bd448f919cec344c6a..f4a110b82edc279237f5c6756a7f2aa30f5967fa 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -55,7 +55,7 @@ static const char rcsid[]="$Id$";
 #define CHECK_MODE(x)  if (!(x)) \
                        { \
                                mutt_flushinp (); \
-                               mutt_error ("Not available in this menu."); \
+                               mutt_error _("Not available in this menu."); \
                                break; \
                        }
 
@@ -69,7 +69,7 @@ static const char rcsid[]="$Id$";
 #define CHECK_ATTACH if(option(OPTATTACHMSG)) \
                     {\
                        mutt_flushinp (); \
-                       mutt_error ("Function not permitted in attach-message mode."); \
+                       mutt_error _("Function not permitted in attach-message mode."); \
                        break; \
                     }
 
@@ -1020,6 +1020,10 @@ display_line (FILE *f, long *last_pos, struct line_t **lineInfo, int n,
 
       resolve_types ((char *) fmt, *lineInfo, n, *last,
                      QuoteList, q_level, force_redraw, flags & M_SHOWCOLOR);
+
+      /* avoid race condition for continuation lines when scrolling up */
+      for (m = n + 1; m < *last && (*lineInfo)[m].offset && (*lineInfo)[m].continuation; m++)
+       (*lineInfo)[m].type = (*lineInfo)[n].type;
     }
 
     /* this also prevents searching through the hidden lines */
@@ -1028,7 +1032,7 @@ display_line (FILE *f, long *last_pos, struct line_t **lineInfo, int n,
   }
 
   /* At this point, (*lineInfo[n]).quote may still be undefined. We 
-   * don't wont to compute it every time M_TYPES is set, since this
+   * don't want to compute it every time M_TYPES is set, since this
    * would slow down the "bottom" function unacceptably. A compromise
    * solution is hence to call regexec() again, just to find out the
    * length of the quote prefix.
diff --git a/parse.c b/parse.c
index 97f8c05851a4e1b4e5e916e26e5c7ec9b30e7091..a8f9cbf0db26853897b22ba7ad8b165ad6b94b95 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -427,6 +427,17 @@ void mutt_parse_part (FILE *fp, BODY *b)
          b->parts = mutt_read_mime_header (fp, 0);
       }
       break;
+
+    default:
+      return;
+  }
+
+  /* try to recover from parsing error */
+  if (!b->parts)
+  {
+    b->type = TYPETEXT;
+    safe_free ((void **) &b->subtype);
+    b->subtype = safe_strdup ("plain");
   }
 }
 
@@ -459,21 +470,7 @@ BODY *mutt_parse_messageRFC822 (FILE *fp, BODY *parent)
   if (msg->length < 0)
     msg->length = 0;
 
-  if (msg->type == TYPEMULTIPART)
-    msg->parts = mutt_parse_multipart (fp, mutt_get_parameter ("boundary", msg->parameter), msg->offset + msg->length, mutt_strcasecmp ("digest", msg->subtype) == 0);
-  else if (msg->type == TYPEMESSAGE)
-    msg->parts = mutt_parse_messageRFC822 (fp, msg);
-  else
-    return (msg);
-  
-  /* try to recover from parsing error */
-  if (!msg->parts)
-  {
-    msg->type = TYPETEXT;
-    safe_free ((void **) &msg->subtype);
-    msg->subtype = safe_strdup ("plain");
-  }
-
+  mutt_parse_part(fp, msg);
   return (msg);
 }
 
@@ -813,27 +810,7 @@ void mutt_parse_mime_message (CONTEXT *ctx, HEADER *cur)
 
   if ((msg = mx_open_message (ctx, cur->msgno)))
   {
-    fseek (msg->fp, cur->content->offset, 0);
-
-    if (cur->content->type == TYPEMULTIPART)
-    {
-      if (!cur->content->parts)
-       cur->content->parts = mutt_parse_multipart (msg->fp, mutt_get_parameter ("boundary", cur->content->parameter), cur->content->offset + cur->content->length, mutt_strcasecmp ("digest", cur->content->subtype) == 0);
-    }
-    else
-    {
-      if (!cur->content->parts)
-       cur->content->parts = mutt_parse_messageRFC822 (msg->fp, cur->content);
-    }
-
-    /* try to recover from parsing error */
-    if (!cur->content->parts)
-    {
-      cur->content->type = TYPETEXT;
-      safe_free ((void **) &cur->content->subtype);
-      cur->content->subtype = safe_strdup ("plain");
-    }
-    
+    mutt_parse_part (msg->fp, cur->content);
 
 
 #ifdef _PGPPATH
diff --git a/pgp.c b/pgp.c
index a3c41977c34a102910ec6e886fcf9c587d3dc930..68041be47942b529af18f4da10a041be2ec87466 100644 (file)
--- a/pgp.c
+++ b/pgp.c
@@ -908,16 +908,7 @@ BODY *pgp_decrypt_part (BODY *a, STATE *s, FILE *fpout)
 
     /* See if we need to recurse on this MIME part.  */
 
-    if (tattach->type == TYPEMULTIPART)
-    {
-      fseek (fpout, tattach->offset, 0);
-      tattach->parts = mutt_parse_multipart (fpout, mutt_get_parameter ("boundary", tattach->parameter), tattach->offset + tattach->length, mutt_strcasecmp ("digest", tattach->subtype) == 0);
-    }
-    else if (tattach->type == TYPEMESSAGE)
-    {
-      fseek (fpout, tattach->offset, 0);
-      tattach->parts = mutt_parse_messageRFC822 (fpout, tattach);
-    }
+    mutt_parse_part (fpout, tattach);
   }
 
   return (tattach);
index cdf9a572ffbd93d37b3c56a704834a803b06cfb0..31b7ea3d8d23792db6004aee5414f9adad7f59e9 100644 (file)
@@ -405,17 +405,7 @@ int mutt_prepare_edit_message (CONTEXT *ctx, HEADER *newhdr, HEADER *hdr)
   {
     BODY *b;
 
-    fseek (msg->fp, hdr->content->offset, 0);
-
-    if (hdr->content->type == TYPEMULTIPART)
-    {
-      hdr->content->parts = mutt_parse_multipart (msg->fp, 
-              mutt_get_parameter ("boundary", hdr->content->parameter),
-              hdr->content->offset + hdr->content->length,
-              mutt_strcasecmp ("digest", hdr->content->subtype) == 0);
-    }
-    else
-      hdr->content->parts = mutt_parse_messageRFC822 (msg->fp, hdr->content);
+    mutt_parse_part (msg->fp, hdr->content);
 
     /* Now that we know what was in the other message, convert to the new
      * message.