diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2014-05-28 11:39:16 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2014-05-28 11:39:16 +0000 |
commit | 1dc730e37c6647c3e87b0ec216304a28ecb26231 (patch) | |
tree | 8748f52451e8be3698e2ca73dfe836bb24d70f1c /usr.bin | |
parent | 731c0ec0ed91f0b2eddc8427271f66a7a3acd676 (diff) |
When invoked as more, make the -i option behave the same as less's
-I to match POSIX. OK and man bits from jmc@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/less/less.1 | 13 | ||||
-rw-r--r-- | usr.bin/less/pattern.c | 2 | ||||
-rw-r--r-- | usr.bin/less/search.c | 3 |
3 files changed, 14 insertions, 4 deletions
diff --git a/usr.bin/less/less.1 b/usr.bin/less/less.1 index d1488792e2c..87ea82c95fa 100644 --- a/usr.bin/less/less.1 +++ b/usr.bin/less/less.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: less.1,v 1.41 2014/05/13 22:07:03 jmc Exp $ +.\" $OpenBSD: less.1,v 1.42 2014/05/28 11:39:15 millert Exp $ .\" .\" Copyright (C) 1984-2012 Mark Nudelman .\" @@ -23,7 +23,7 @@ .\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: May 13 2014 $ +.Dd $Mdocdate: May 28 2014 $ .Dt LESS 1 .Os .Sh NAME @@ -1609,6 +1609,15 @@ to exit the first time it reaches EOF, not the second. .Pp The +.Fl i +option acts like the +.Fl I +option. +The normal behavior of the +.Fl i +option is unavailable in this mode. +.Pp +The .Fl m option works differently: if it is not specified, the medium prompt is used; diff --git a/usr.bin/less/pattern.c b/usr.bin/less/pattern.c index fd1fcf5f768..bc346fd8bc2 100644 --- a/usr.bin/less/pattern.c +++ b/usr.bin/less/pattern.c @@ -127,7 +127,7 @@ compile_pattern(pattern, search_type, comp_pattern) char *cvt_pattern; int result; - if (caseless != OPT_ONPLUS) + if (caseless != OPT_ONPLUS && (caseless != OPT_ON || !less_is_more)) cvt_pattern = pattern; else { diff --git a/usr.bin/less/search.c b/usr.bin/less/search.c index 49c3917ac90..770a0623ced 100644 --- a/usr.bin/less/search.c +++ b/usr.bin/less/search.c @@ -39,6 +39,7 @@ extern int hilite_search; extern int size_linebuf; extern int squished; extern int can_goto_line; +extern int less_is_more; static int hide_hilite; static POSITION prep_startpos; static POSITION prep_endpos; @@ -122,7 +123,7 @@ set_pattern(info, pattern, search_type) * -i is set AND the pattern is all lowercase. */ is_ucase_pattern = is_ucase(pattern); - if (is_ucase_pattern && caseless != OPT_ONPLUS) + if (is_ucase_pattern && caseless != OPT_ONPLUS && (caseless != OPT_ON || !less_is_more)) is_caseless = 0; else is_caseless = caseless; |