]> granicus.if.org Git - mutt/commitdiff
Fix the display of DEL in the pager.
authorThomas Roessler <roessler@does-not-exist.org>
Mon, 9 Nov 1998 10:47:17 +0000 (10:47 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Mon, 9 Nov 1998 10:47:17 +0000 (10:47 +0000)
help.c
pager.c

diff --git a/help.c b/help.c
index 75ecd7fb7d6f4f55dd6a34444f8535aa7931b59c..4defe764e9f97acc11d8e1b6f177d744e5b257a1 100644 (file)
--- a/help.c
+++ b/help.c
@@ -87,14 +87,14 @@ mutt_compile_help (char *buf, size_t buflen, int menu, struct mapping_t *items)
 
 static int print_macro (FILE *f, int maxchar, const char **macro)
 {
-  int c = **macro;
+  int c = (unsigned char) **macro;
   int n = maxchar;
 
   while (c)
   {
     if (!IsPrint(c))
     {
-      if (c >= ' ')
+      if (c >= ' ' && c != 127)
        c = '?';
       else if (n < 2)
        c = 0;
@@ -121,7 +121,7 @@ static int print_macro (FILE *f, int maxchar, const char **macro)
            break;
          default:
            fputc ('^', f);
-           c += '@';
+           c = (c + '@') & 127;
            break;
        }
       }
diff --git a/pager.c b/pager.c
index 7fa7130122bbe54565c298ddf993cb78dd6293a6..3be2ca553219c78053a982e8de9a78dfc0cd6e8b 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -1284,7 +1284,7 @@ display_line (FILE *f, long *last_pos, struct line_t **lineInfo, int n,
       addch (c);
       col++;
     }
-    else if (iscntrl (c) && c < '@')
+    else if (iscntrl (c) && (c < '@' || c == 127))
     {
       if ((c != '\r' && c !='\n') || (buf[ch+1] != '\n' && buf[ch+1] != '\0'))
       {
@@ -1297,7 +1297,7 @@ display_line (FILE *f, long *last_pos, struct line_t **lineInfo, int n,
        }
 
        addch ('^');
-       addch (c + '@');
+       addch ((c + '@') & 127);
        col += 2;
       }
     }
@@ -1314,7 +1314,7 @@ display_line (FILE *f, long *last_pos, struct line_t **lineInfo, int n,
       if (ISSPACE (c))
        addch (c);              /* unbreakable space */
       else
-       addch ('.');
+       addch ('?');
       col++;
     }
   }