Date: Fri, 13 Mar 1998 16:46:59 -0500 (EST) From: Max Euston <meuston@jmrodgers.com> To: FreeBSD-gnats-submit@FreeBSD.ORG Subject: bin/5996: more(1) '-#' broken (obsolete) and h)elp does not pause Message-ID: <199803132146.QAA02526@gw.jmrodgers.com>
next in thread | raw e-mail | index | archive | help
>Number: 5996
>Category: bin
>Synopsis: more(1) '-#' broken (obsolete) and h)elp does not pause
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Fri Mar 13 13:50:00 PST 1998
>Last-Modified:
>Originator: Max Euston
>Organization:
>Release: FreeBSD 2.2.5-STABLE i386
>Environment:
-STABLE
>Description:
2 problems:
- the '-#' option was meant to specify screen height, but has
not worked as far back as I can check in the revision history.
(as per the discussions on "hackers", I have removed this option).
this can be achieved by 'stty rows XX', so this option is now
obsolete.
- when displaying h)elp, more(1) does not pause before redrawing
the screen (unless you have MORE=-e in your environment).
>How-To-Repeat:
see Description
>Fix:
diff -u /usr/src/usr.bin/more/help.c ./help.c
--- /usr/src/usr.bin/more/help.c Fri May 27 08:30:46 1994
+++ ./help.c Wed Feb 18 10:27:41 1998
@@ -40,10 +40,12 @@
#include <less.h>
#include "pathnames.h"
+extern int top_scroll;
+
help()
{
char cmd[MAXPATHLEN + 20];
- (void)sprintf(cmd, "-more %s", _PATH_HELPFILE);
+ (void)sprintf(cmd, "-more -e%c %s", top_scroll ? 'c' : ' ', _PATH_HELPFILE);
lsystem(cmd);
}
diff -u /usr/src/usr.bin/more/more.1 ./more.1
--- /usr/src/usr.bin/more/more.1 Wed Jul 30 02:43:57 1997
+++ ./more.1 Wed Feb 25 11:28:20 1998
@@ -40,11 +40,10 @@
.Nd file perusal filter for crt viewing
.Sh SYNOPSIS
.Nm
-.Op Fl ceinus
+.Op Fl ceinsu
.Op Fl t Ar tag
.Op Fl x Ar tabs
.Op Fl / Ar pattern
-.Op Fl #
.Op Ar
.Sh DESCRIPTION
.Nm More
diff -u /usr/src/usr.bin/more/option.c ./option.c
--- /usr/src/usr.bin/more/option.c Mon Sep 15 05:20:52 1997
+++ ./option.c Tue Feb 24 14:45:27 1998
@@ -54,7 +54,6 @@
int tagoption;
char *firstsearch;
-extern int sc_height;
static void usage __P((void));
@@ -75,23 +74,8 @@
(*a)[0] = '-';
optind = 1; /* called twice, re-init getopt. */
- while ((ch = getopt(argc, argv, "0123456789/:ceinst:ux:f")) != -1)
+ while ((ch = getopt(argc, argv, "/:ceinst:ux:f")) != -1)
switch((char)ch) {
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- /*
- * kludge: more was originally designed to take
- * a number after a dash.
- */
- if (!sc_window_set) {
- p = argv[optind - 1];
- if (p[0] == '-' && p[1] == ch && !p[2])
- sc_height = atoi(++p);
- else
- sc_height = atoi(argv[optind] + 1);
- sc_window_set = 1;
- }
- break;
case '/':
firstsearch = optarg;
break;
@@ -135,6 +119,6 @@
usage()
{
fprintf(stderr,
- "usage: more [-ceinus] [-t tag] [-x tabs] [-/ pattern] [-#] [file ...]\n");
+ "usage: more [-ceinsu] [-t tag] [-x tabs] [-/ pattern] [file ...]\n");
exit(1);
}
diff -u /usr/src/usr.bin/more/screen.c ./screen.c
--- /usr/src/usr.bin/more/screen.c Sat Aug 5 17:25:28 1995
+++ ./screen.c Wed Feb 25 11:27:57 1998
@@ -265,13 +265,14 @@
#ifdef TIOCGWINSZ
if (ioctl(2, TIOCGWINSZ, &w) == 0 && w.ws_row > 0)
sc_height = w.ws_row;
+ else
#else
#ifdef WIOCGETD
if (ioctl(2, WIOCGETD, &w) == 0 && w.uw_height > 0)
sc_height = w.uw_height/w.uw_vs;
+ else
#endif
#endif
- else
sc_height = tgetnum("li");
hard = (sc_height < 0 || tgetflag("hc"));
if (hard) {
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199803132146.QAA02526>
