Date: Wed, 25 Feb 1998 08:50:05 -0800 (PST) From: Max Euston <meuston@jmrodgers.com> To: freebsd-bugs Subject: RE: bin/5838: Minor fixes to more(1) (was: Make more(1) use LINES= and COLUMNS= environment variables. ) Message-ID: <199802251650.IAA19961@hub.freebsd.org>
index | next in thread | raw e-mail
The following reply was made to PR bin/5838; it has been noted by GNATS.
From: Max Euston <meuston@jmrodgers.com>
To: "'Bill Fenner'" <fenner@parc.xerox.com>
Cc: "FreeBSD-gnats-submit@freebsd.org" <FreeBSD-gnats-submit@freebsd.org>
Subject: RE: bin/5838: Minor fixes to more(1) (was: Make more(1) use LINES= and COLUMNS= environment variables. )
Date: Wed, 25 Feb 1998 11:35:45 -0500
On Wednesday, February 25, 1998 11:16 AM, Bill Fenner [SMTP:fenner@parc.xerox.com] wrote:
> You could just submit a revised diff without LINES and COLUMNS as a
> followup to this conversation; since it's cc'd to freebsd-gnats-submit,
> it'll be appended to the PR.
>
> Bill
>
(once I get cvs installed, these should be in the more standard format...)
*****
diff -u /usr/src/usr.bin/more/help.c /usr/local/src/usr.bin/more/help.c
--- /usr/src/usr.bin/more/help.c Fri May 27 08:30:46 1994
+++ /usr/local/src/usr.bin/more/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 /usr/local/src/usr.bin/more/more.1
--- /usr/src/usr.bin/more/more.1 Wed Jul 30 02:43:57 1997
+++ /usr/local/src/usr.bin/more/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 /usr/local/src/usr.bin/more/option.c
--- /usr/src/usr.bin/more/option.c Mon Sep 15 05:20:52 1997
+++ /usr/local/src/usr.bin/more/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 /usr/local/src/usr.bin/more/screen.c
--- /usr/src/usr.bin/more/screen.c Sat Aug 5 17:25:28 1995
+++ /usr/local/src/usr.bin/more/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) {
*****
-----
Max Euston <meuston@jmrodgers.com>
Sysadm, Programmer, etc...
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199802251650.IAA19961>
