Subject: bin/8269: 1.4.1 'more' / (search) mishandles !, possibly others.
To: None <gnats-bugs@gnats.netbsd.org>
From: None <cgd@netbsd.org>
List: netbsd-bugs
Date: 08/24/1999 14:00:38
>Number:         8269
>Category:       bin
>Synopsis:       1.4.1 'more' / (search) mishandles !, possibly others.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 24 13:50:01 1999
>Last-Modified:
>Originator:     Chris Demetriou
>Organization:
Hate-filled Weasel Preservation Society
>Release:        1.4.1
>Environment:
1.4.1 on i386.

>Description:
NetBSD 1.4.1's "more" mishandles searching for ! as the
first character of a search string.  Instead of searching
for the character !, it decides to search for lines which
don't match the rest of the pattern!

Solaris 'more', and even linux 'more', do the right thing.
(Those are the only systems i have easilu available to
test right now.

Discussion with Charles Hannum and others indicates 
that is also mishandles /* (which for consistency with
other utils like grep and vi should search for * -- this is
what linux does, but solaris says regular expression botch),
$ (which vi/grep apparently great as literal unless it's
the last thing on the line -- didn't test linux or solaris),
and @ (should search for @, instead does something about "First-file"
which isn't immediately obvious to me).

While complete consistency with vi/grep would probably be nice but may
not be necessary, compatibility with other versions of 'more' for
handling of things like ! and @ really is necessary.

>How-To-Repeat:
more a file, for instance /etc/rc.

compare the results of:

	more /etc/rc then /! -name
	grep '! -name' /etc/rc

	more /etc/sendmail.cf then /@>
	grep '@>' /etc/sendmail.cf

etc.
>Fix:
unknown

>Audit-Trail:
>Unformatted: