]> granicus.if.org Git - neomutt/commitdiff
A different fix for the '\012' issue. Bug tracked down by Johannes
authorThomas Roessler <roessler@does-not-exist.org>
Sun, 13 Jan 2002 08:52:15 +0000 (08:52 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Sun, 13 Jan 2002 08:52:15 +0000 (08:52 +0000)
Geiger <geiger@ePost.de>.

muttlib.c
pager.c

index 72222316ee7d8d1aa7f02bd32e9e7206f3185dae..53d696c3453508ca8b39221df84b7e331f30297c 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -1227,9 +1227,7 @@ void state_attach_puts (const char *t, STATE *s)
   while (*t)
   {
     state_putc (*t, s);
-    if (*t++ == '\n' && *t && IsPrint (*t)) /* Is the IsPrint() here really
-                                            * the right way to fix this?
-                                            */
+    if (*t++ == '\n' && *t)
       state_mark_attach (s);
   }
 }
diff --git a/pager.c b/pager.c
index 0a5de9daa5eb07342a81eb569fc1ef528ab90089..2c5f1183429a3522ae5a4e83f78a72778c82cb6c 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -1051,9 +1051,14 @@ static int format_line (struct line_t **lineInfo, int n, unsigned char *buf,
           check_attachment_marker ((char *) buf+ch) == 0)
     {
       while (buf[ch++] != '\a')
-       ;
+       if (ch >= cnt)
+         break;
     }
 
+    /* is anything left to do? */
+    if (ch >= cnt)
+      break;
+    
     k = mbrtowc (&wc, (char *)buf+ch, cnt-ch, &mbstate);
     if (k == -2 || k == -1)
     {