aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/main.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-04-18 16:01:20 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-04-18 16:01:20 +0000
commit50c21bf04a5555959f2d160928ffd6136da05d7a (patch)
tree18a5f927d09c9d82a5921231813feb32d2215bc4 /main.c
parenta1a544ae6cc46457ab2bdb84b0c9a8b0a3f8828b (diff)
downloadmandoc-50c21bf04a5555959f2d160928ffd6136da05d7a.tar.gz
mandoc-50c21bf04a5555959f2d160928ffd6136da05d7a.tar.zst
mandoc-50c21bf04a5555959f2d160928ffd6136da05d7a.zip
Now that global -i is gone, pass -i through to the apropos(1)
expression parser, such that "apropos -i 'Nm~dump\>'" finds kdump(1) and WCOREDUMP(2) and you don't need to type the counter-intuitive "apropos -- -i 'Nm~dump\>'".
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/main.c b/main.c
index 66dbd94f..99daeeca 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.288 2017/04/18 15:27:09 schwarze Exp $ */
+/* $Id: main.c,v 1.289 2017/04/18 16:01:20 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2012, 2014-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -193,8 +193,12 @@ main(int argc, char *argv[])
show_usage = 0;
outmode = OUTMODE_DEF;
- while (-1 != (c = getopt(argc, argv,
- "aC:cfhI:iK:klM:m:O:S:s:T:VW:w"))) {
+ while ((c = getopt(argc, argv,
+ "aC:cfhI:iK:klM:m:O:S:s:T:VW:w")) != -1) {
+ if (c == 'i' && search.argmode == ARG_EXPR) {
+ optind--;
+ break;
+ }
switch (c) {
case 'a':
outmode = OUTMODE_ALL;