aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit24aa75fc8e165b92f3c9be4e0289af2351303ba5 (patch)
treee8b7ad3508df0b66b328999c516cbeef1a0a26e2
parentf81dd1c2968cfaa2ccb3fc5cc68f4915ff10c312 (diff)
downloadmandoc-24aa75fc8e165b92f3c9be4e0289af2351303ba5.tar.gz
mandoc-24aa75fc8e165b92f3c9be4e0289af2351303ba5.tar.zst
mandoc-24aa75fc8e165b92f3c9be4e0289af2351303ba5.zip
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;