diff options
author | 2017-04-18 15:04:35 +0000 | |
---|---|---|
committer | 2017-04-18 15:04:35 +0000 | |
commit | 76cc2bb0d3f922c9a83f0348f0278fd48d576502 (patch) | |
tree | a759d9a9963a6495445187a65e3c678e67fda0c6 | |
parent | Style nits; no binary change. (diff) | |
download | wireguard-openbsd-76cc2bb0d3f922c9a83f0348f0278fd48d576502.tar.xz wireguard-openbsd-76cc2bb0d3f922c9a83f0348f0278fd48d576502.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-- | usr.bin/mandoc/mansearch.c | 9 |
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; |