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
This commit is contained in:
Yorhel 2016-10-16 10:27:47 +02:00
parent 5436435c3f
commit a7352d27b9
2 changed files with 3 additions and 3 deletions

View file

@ -30,7 +30,7 @@ sub fmt {
# doesn't '.so' it. # doesn't '.so' it.
$input =~ s/^\.so man.macros$//mg; $input =~ s/^\.so man.macros$//mg;
# Other .so's should be handled by html() # 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. :-( # Disable hyphenation, since that screws up man page references. :-(
$input = ".hy 0\n.de hy\n..\n$input"; $input = ".hy 0\n.de hy\n..\n$input";

View file

@ -100,7 +100,7 @@ static void flushinclude(ctx_t *x) {
char *s = x->line; char *s = x->line;
s[x->linelen-3] = 0; s[x->linelen-3] = 0;
s += 17; s += 16;
char *fn = strrchr(s, '/'); char *fn = strrchr(s, '/');
fn = fn ? fn+1 : s; fn = fn ? fn+1 : s;
sv_catpv(x->dest, "&gt;&gt; Included manual page: <a href=\"/"); sv_catpv(x->dest, "&gt;&gt; Included manual page: <a href=\"/");
@ -133,7 +133,7 @@ static void flushline(ctx_t *x) {
char *s = x->line, *es = x->line; char *s = x->line, *es = x->line;
// Special-case [[[MANNEDINCLUDE ..]]] directive // 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); flushinclude(x);
goto end; goto end;
} }