summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-04-18 15:06:49 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-04-18 15:06:49 +0000
commit81698dc781dda96de839f963e851f9696a1ba9b7 (patch)
treede3fb7e083ccdb01b9db8f70ea6727441c510037
parent135480d0ab61464405f81a700409bf21bb994017 (diff)
downloadmandoc-81698dc781dda96de839f963e851f9696a1ba9b7.tar.gz
The apropos(1) manual still documents the unary -i operator for
regular expression search terms, but it appears that somewhere along the way, the implementation got lost, so restore it. Bug found while investigating other reports from Gonzalo Tornaria.
-rw-r--r--mansearch.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/mansearch.c b/mansearch.c
index 1a5eba7f..d7444137 100644
--- a/mansearch.c
+++ b/mansearch.c
@@ -672,6 +672,12 @@ exprterm(const struct mansearch *search, int argc, char *argv[], int *argi)
return e;
}
+ if (strcmp("-i", argv[*argi]) == 0 && *argi + 1 < argc) {
+ cs = 0;
+ ++*argi;
+ } else
+ cs = 1;
+
e = mandoc_calloc(1, sizeof(*e));
e->type = EXPR_TERM;
e->bits = 0;
@@ -690,7 +696,6 @@ exprterm(const struct mansearch *search, int argc, char *argv[], int *argi)
* If needed, request regular expression handling.
*/
- cs = 1;
if (search->argmode == ARG_WORD) {
e->bits = TYPE_Nm;
e->match.type = DBM_REGEX;