summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2017-04-18 15:04:36 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2017-04-18 15:04:36 +0000
commit4fd7821fd04c66bec68557e30c8a07d39b5c0117 (patch)
treec43a4397a9a135a7dbf425d90975c145f953ab3d /usr.bin
parent513006ff94ba98e116adc311f6f4c4312f2ac4bf (diff)
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.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mandoc/mansearch.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.bin/mandoc/mansearch.c b/usr.bin/mandoc/mansearch.c
index e56e758f311..cad99d58ab5 100644
--- a/usr.bin/mandoc/mansearch.c
+++ b/usr.bin/mandoc/mansearch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mansearch.c,v 1.54 2017/04/18 13:57:12 schwarze Exp $ */
+/* $OpenBSD: mansearch.c,v 1.55 2017/04/18 15:04:35 schwarze Exp $ */
/*
* Copyright (c) 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -669,6 +669,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;
@@ -687,7 +693,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;