summaryrefslogtreecommitdiffstats
path: root/man.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-08-21 12:32:38 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-08-21 12:32:38 +0000
commit270a33558b8c086b899f49f34e1d47da4792b7b8 (patch)
tree2a1c0cbef9edfff1a3fd8f1135fc17fed30bfd7d /man.c
parentd8d8e19a17345326342a05e737487b04fa994353 (diff)
downloadmandoc-270a33558b8c086b899f49f34e1d47da4792b7b8.tar.gz
Fixed `nf' behaviour (had broken with de-chunking).
Added warnings if literal context already open/closed.
Diffstat (limited to 'man.c')
-rw-r--r--man.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/man.c b/man.c
index c2f51ed5..5c152e1b 100644
--- a/man.c
+++ b/man.c
@@ -41,7 +41,9 @@ const char *const __man_merrnames[WERRMAX] = {
"unknown macro", /* WMACRO */
"ill-formed macro", /* WMACROFORM */
"scope open on exit", /* WEXITSCOPE */
- "no scope context" /* WNOSCOPE */
+ "no scope context", /* WNOSCOPE */
+ "literal context already open", /* WOLITERAL */
+ "no literal context open" /* WNLITERAL */
};
const char *const __man_macronames[MAN_MAX] = {
@@ -392,6 +394,14 @@ man_ptext(struct man *m, int line, char *buf)
{
int i, j;
+ /* Literal free-form text whitespace is preserved. */
+
+ if (MAN_LITERAL & m->flags) {
+ if ( ! man_word_alloc(m, line, 0, buf))
+ return(0);
+ goto descope;
+ }
+
/* First de-chunk and allocate words. */
for (i = 0; ' ' == buf[i]; i++)