From f7427e85eed5148029e2e1d716d6d0257222cc76 Mon Sep 17 00:00:00 2001 From: rofl0r Date: Sat, 22 Aug 2020 00:07:14 +0100 Subject: [PATCH] man: fix newline output in nofill (.nf) mode on encountering a new .-prefixed directive, man wouldn't output a newline. this fixes rendering of linux manpages such as dsp56k.4, as well as xorg manpages such as xf86-video-intel/intel.4. --- man.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/man.c b/man.c index 6400723..3a7fbe3 100644 --- a/man.c +++ b/man.c @@ -369,6 +369,9 @@ static void do_file(void) { keep_nl--; } + if(nl == 1 && no_fill) + line_break(); + if(nl == 1 && (word[0] == '.' || (word[0] == '\'' && strcmp(word, "'\\\"") == 0) || (word[0] == '\'' && strcmp(word, "'''") == 0) @@ -377,8 +380,6 @@ static void do_file(void) { if(do_command() < 0) break; } else { - if(nl == 1 && no_fill) - line_break(); if(*whitespace) print_word(whitespace); print_word(word); -- 2.11.4.GIT