Subject: bin/2484: "more" behavior wrong on directories
To: None <gnats-bugs@NetBSD.ORG>
From: None <hamby@aris.jpl.nasa.gov>
List: netbsd-bugs
Date: 05/29/1996 11:12:21
>Number: 2484
>Category: bin
>Synopsis: When called as "more", less should not view directories by default
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people (Utility Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed May 29 14:50:05 1996
>Last-Modified:
>Originator: Jake Hamby
>Organization:
Jet Propulsion Laboratory
>Release: 1.2_ALPHA
>Environment:
System: NetBSD slowaris.jpl.nasa.gov 1.2_ALPHA NetBSD 1.2_ALPHA (SLOWARIS) #3: Tue May 28 14:36:18 PDT 1996 hamby@slowaris.jpl.nasa.gov:/usr/src/sys/arch/sparc/compile/SLOWARIS sparc
>Description:
When called as "more", less will view the contents of a directory inode, instead of printing
"/foo is a directory" and exiting. I have found no historical version of more (SunOS, Solaris, FreeBSD)
that has this behavior, so it should be changed to conform to "less" default.
>How-To-Repeat:
Type "more /usr" or any other directory name. It will print garbage (the contents of the directory
inode) instead of "/usr is a directory."
>Fix:
Apply the following patch to /usr/src/usr.bin/less/less/main.c
*** main.c.orig Wed May 29 10:32:01 1996
--- main.c Wed May 29 10:32:41 1996
***************
*** 104,110 ****
scan_option("-E");
scan_option("-m");
scan_option("-G");
! scan_option("-f");
scan_option(getenv("MORE"));
} else
scan_option(getenv("LESS"));
--- 104,110 ----
scan_option("-E");
scan_option("-m");
scan_option("-G");
! /* scan_option("-f"); /* don't "more" directories by default */
scan_option(getenv("MORE"));
} else
scan_option(getenv("LESS"));
>Audit-Trail:
>Unformatted: