summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2017-02-04 11:56:48 +0000
committerschwarze <schwarze@openbsd.org>2017-02-04 11:56:48 +0000
commit0b7c4dd875b4710ffb99d1cf01f4bdfe0bdb9440 (patch)
treeb6199cfbc213d389ca0a11e11355d3fa50881327
parentUpdate usage for ps/w to match previous commit (diff)
downloadwireguard-openbsd-0b7c4dd875b4710ffb99d1cf01f4bdfe0bdb9440.tar.xz
wireguard-openbsd-0b7c4dd875b4710ffb99d1cf01f4bdfe0bdb9440.zip
Do not fix the default indent for all subsequent files; some may use
a different macro language and hence require a different indent. You can see the effect with "man -a 1 host hostname".
-rw-r--r--usr.bin/mandoc/man_term.c7
-rw-r--r--usr.bin/mandoc/mdoc_term.c5
2 files changed, 9 insertions, 3 deletions
diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c
index 5e581a7884b..c1db2c0dd47 100644
--- a/usr.bin/mandoc/man_term.c
+++ b/usr.bin/mandoc/man_term.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: man_term.c,v 1.141 2017/01/10 13:46:53 schwarze Exp $ */
+/* $OpenBSD: man_term.c,v 1.142 2017/02/04 11:56:48 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010-2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -141,6 +141,7 @@ terminal_man(void *arg, const struct roff_man *man)
struct termp *p;
struct roff_node *n;
struct mtermp mt;
+ size_t save_defindent;
p = (struct termp *)arg;
p->overstep = 0;
@@ -168,6 +169,7 @@ terminal_man(void *arg, const struct roff_man *man)
n = n->next;
}
} else {
+ save_defindent = p->defindent;
if (p->defindent == 0)
p->defindent = 7;
term_begin(p, print_man_head, print_man_foot, &man->meta);
@@ -175,6 +177,7 @@ terminal_man(void *arg, const struct roff_man *man)
if (n != NULL)
print_man_nodelist(p, &mt, n, &man->meta);
term_end(p);
+ p->defindent = save_defindent;
}
}
diff --git a/usr.bin/mandoc/mdoc_term.c b/usr.bin/mandoc/mdoc_term.c
index f176d689de6..c5735362072 100644
--- a/usr.bin/mandoc/mdoc_term.c
+++ b/usr.bin/mandoc/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mdoc_term.c,v 1.240 2017/01/11 17:39:45 schwarze Exp $ */
+/* $OpenBSD: mdoc_term.c,v 1.241 2017/02/04 11:56:48 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -256,6 +256,7 @@ terminal_mdoc(void *arg, const struct roff_man *mdoc)
{
struct roff_node *n;
struct termp *p;
+ size_t save_defindent;
p = (struct termp *)arg;
p->overstep = 0;
@@ -276,6 +277,7 @@ terminal_mdoc(void *arg, const struct roff_man *mdoc)
n = n->next;
}
} else {
+ save_defindent = p->defindent;
if (p->defindent == 0)
p->defindent = 5;
term_begin(p, print_mdoc_head, print_mdoc_foot,
@@ -288,6 +290,7 @@ terminal_mdoc(void *arg, const struct roff_man *mdoc)
print_mdoc_nodelist(p, NULL, &mdoc->meta, n);
}
term_end(p);
+ p->defindent = save_defindent;
}
}