diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-03-11 13:11:22 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-03-11 13:11:22 +0000 |
commit | b68603956c1ef2a1054c002436569a922e602d3b (patch) | |
tree | 267df192f0a6587beb3ae5bb472e5c19ca72a053 | |
parent | a6b05481ff237dc3c50886dab2642a2d007a78ff (diff) | |
download | mandoc-b68603956c1ef2a1054c002436569a922e602d3b.tar.gz |
When interpreting the -O argument as a macro name fails,
fall back to showing Nd rather than not showing anything.
Issue reported by jmc@.
-rw-r--r-- | TODO | 5 | ||||
-rw-r--r-- | mansearch.c | 5 |
2 files changed, 8 insertions, 2 deletions
@@ -557,6 +557,11 @@ Several areas can be cleaned up to make mandoc even faster. These are * structural issues ************************************************************************ +- Improve -O suboption parsing. Do it in the main program such that + errors can be reported. Pay attention to distinguishing the + mandoc(1) and apropos(1) styles of both options. + loc ** exist * algo ** size ** imp *** + - Use libz directly instead of forking gunzip(1). Suggested by bapt at FreeBSD among others. diff --git a/mansearch.c b/mansearch.c index 72324544..f0046de9 100644 --- a/mansearch.c +++ b/mansearch.c @@ -195,8 +195,8 @@ mansearch(const struct mansearch *search, if (NULL == (e = exprcomp(search, argc, argv))) goto out; - outbit = 0; if (NULL != search->outkey) { + outbit = TYPE_Nd; for (indexbit = 0, iterbit = 1; indexbit < mansearch_keymax; indexbit++, iterbit <<= 1) { @@ -206,7 +206,8 @@ mansearch(const struct mansearch *search, break; } } - } + } else + outbit = 0; /* * Save a descriptor to the current working directory. |