From a7352d27b9f6d246cd02c24dba29ebb7058bd353 Mon Sep 17 00:00:00 2001 From: Yorhel Date: Sun, 16 Oct 2016 10:27:47 +0200 Subject: [PATCH] Fix possible wrapping of MANNEDINCLUDE by removing space This doesn't really guarantee that it won't wrap, but fixes at least one man page. - https://manned.org/BlockSelectionDCOPInterface/6dfdf921 --- lib/ManUtils/ManUtils.pm | 2 +- lib/ManUtils/ManUtils.xs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ManUtils/ManUtils.pm b/lib/ManUtils/ManUtils.pm index 5a5c37e..c8f11f5 100644 --- a/lib/ManUtils/ManUtils.pm +++ b/lib/ManUtils/ManUtils.pm @@ -30,7 +30,7 @@ sub fmt { # doesn't '.so' it. $input =~ s/^\.so man.macros$//mg; # Other .so's should be handled by html() - $input =~ s/^\.so (.+)$/.in -10\n.sp\n\[\[\[MANNEDINCLUDE $1\]\]\]/mg; + $input =~ s/^\.so (.+)$/.in -10\n.sp\n\[\[\[MANNEDINCLUDE$1\]\]\]/mg; # Disable hyphenation, since that screws up man page references. :-( $input = ".hy 0\n.de hy\n..\n$input"; diff --git a/lib/ManUtils/ManUtils.xs b/lib/ManUtils/ManUtils.xs index 2e370d0..630f969 100644 --- a/lib/ManUtils/ManUtils.xs +++ b/lib/ManUtils/ManUtils.xs @@ -100,7 +100,7 @@ static void flushinclude(ctx_t *x) { char *s = x->line; s[x->linelen-3] = 0; - s += 17; + s += 16; char *fn = strrchr(s, '/'); fn = fn ? fn+1 : s; sv_catpv(x->dest, ">> Included manual page: line, *es = x->line; // Special-case [[[MANNEDINCLUDE ..]]] directive - if(x->linelen > 20 && *s == '[' && strncmp(s, "[[[MANNEDINCLUDE ", 17) == 0 && strcmp("]]]", s+x->linelen-3) == 0) { + if(x->linelen > 20 && *s == '[' && strncmp(s, "[[[MANNEDINCLUDE", 16) == 0 && strcmp("]]]", s+x->linelen-3) == 0) { flushinclude(x); goto end; }