From 7d0afed87ebe2305799b98964aa700fe1d9d8bab Mon Sep 17 00:00:00 2001 From: schwarze Date: Tue, 18 Apr 2017 15:59:56 +0000 Subject: [PATCH] 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\>'". --- usr.bin/mandoc/main.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/usr.bin/mandoc/main.c b/usr.bin/mandoc/main.c index ee1d3bdc82f..50071caf5ef 100644 --- a/usr.bin/mandoc/main.c +++ b/usr.bin/mandoc/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.191 2017/04/18 15:26:33 schwarze Exp $ */ +/* $OpenBSD: main.c,v 1.192 2017/04/18 15:59:56 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2012, 2014-2017 Ingo Schwarze @@ -169,8 +169,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; -- 2.20.1