aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-03-11 13:11:22 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-03-11 13:11:22 +0000
commita15fa8df06347a20aa0c820a804ea36dd25e1391 (patch)
tree2dac54db132122c7d7377ec542c28b24409bc34f
parentb0d20148ca7a55127315f5ef158ee8de802e8b4f (diff)
downloadmandoc-a15fa8df06347a20aa0c820a804ea36dd25e1391.tar.gz
mandoc-a15fa8df06347a20aa0c820a804ea36dd25e1391.tar.zst
mandoc-a15fa8df06347a20aa0c820a804ea36dd25e1391.zip
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--TODO7
-rw-r--r--mansearch.c7
2 files changed, 10 insertions, 4 deletions
diff --git a/TODO b/TODO
index ebd488cc..701cd1dd 100644
--- a/TODO
+++ b/TODO
@@ -1,6 +1,6 @@
************************************************************************
* Official mandoc TODO.
-* $Id: TODO,v 1.201 2015/02/20 13:47:28 schwarze Exp $
+* $Id: TODO,v 1.202 2015/03/11 13:11:22 schwarze Exp $
************************************************************************
Many issues are annotated for difficulty as follows:
@@ -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 27cfa655..05e2a0a2 100644
--- a/mansearch.c
+++ b/mansearch.c
@@ -1,4 +1,4 @@
-/* $Id: mansearch.c,v 1.54 2015/02/27 16:02:10 schwarze Exp $ */
+/* $Id: mansearch.c,v 1.55 2015/03/11 13:11:22 schwarze Exp $ */
/*
* Copyright (c) 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -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.