From 24aa75fc8e165b92f3c9be4e0289af2351303ba5 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Tue, 18 Apr 2017 15:06:49 +0000 Subject: 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. --- mansearch.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'mansearch.c') 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; -- cgit v1.2.3