]> granicus.if.org Git - neomutt/commitdiff
Fix built-in pager checks for help and attachments
authorKevin McCarthy <kevin@8t8.us>
Fri, 4 Oct 2019 07:29:03 +0000 (15:29 +0800)
committerRichard Russon <rich@flatcap.org>
Tue, 8 Oct 2019 16:43:58 +0000 (17:43 +0100)
Mutt uses the built-in pager when $pager is unset too.  Fix a few
checks to also handle that case.

Co-authored-by: Richard Russon <rich@flatcap.org>
help.c
state.c

diff --git a/help.c b/help.c
index b0f0a6c34d37dca392f39e80859b8acfcd814344..093280fe97aa96bae8c926271510896ead9cf7cf 100644 (file)
--- a/help.c
+++ b/help.c
@@ -307,7 +307,7 @@ static void format_line(FILE *fp, int ismacro, const char *t1, const char *t2, c
 
   if (ismacro > 0)
   {
-    if (mutt_str_strcmp(C_Pager, "builtin") == 0)
+    if (!C_Pager || (mutt_str_strcmp(C_Pager, "builtin") == 0))
       fputs("_\010", fp); // Ctrl-H (backspace)
     fputs("M ", fp);
     col += 2;
diff --git a/state.c b/state.c
index 4103f6af2bc468303d9ef120f182ae500cc94702..5c92d809379f59b4930ff4ac298677510e925be5 100644 (file)
--- a/state.c
+++ b/state.c
@@ -42,8 +42,11 @@ void state_mark_attach(struct State *s)
 {
   if (!s || !s->fp_out)
     return;
-  if ((s->flags & MUTT_DISPLAY) && (mutt_str_strcmp(C_Pager, "builtin") == 0))
+  if ((s->flags & MUTT_DISPLAY) &&
+      (!C_Pager || (mutt_str_strcmp(C_Pager, "builtin") == 0)))
+  {
     state_puts(AttachmentMarker, s);
+  }
 }
 
 /**
@@ -52,8 +55,11 @@ void state_mark_attach(struct State *s)
  */
 void state_mark_protected_header(struct State *s)
 {
-  if ((s->flags & MUTT_DISPLAY) && (mutt_str_strcmp(C_Pager, "builtin") == 0))
+  if ((s->flags & MUTT_DISPLAY) &&
+      (!C_Pager || (mutt_str_strcmp(C_Pager, "builtin") == 0)))
+  {
     state_puts(ProtectedHeaderMarker, s);
+  }
 }
 
 /**