From root@gw.jmrodgers.com  Fri Mar 13 13:47:40 1998
Received: from gw.jmrodgers.com ([205.247.224.2])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA22923
          for <FreeBSD-gnats-submit@freebsd.org>; Fri, 13 Mar 1998 13:47:31 -0800 (PST)
          (envelope-from root@gw.jmrodgers.com)
Received: (from root@localhost)
	by gw.jmrodgers.com (8.8.8/8.8.8) id QAA02526;
	Fri, 13 Mar 1998 16:46:59 -0500 (EST)
	(envelope-from root)
Message-Id: <199803132146.QAA02526@gw.jmrodgers.com>
Date: Fri, 13 Mar 1998 16:46:59 -0500 (EST)
From: Max Euston <meuston@jmrodgers.com>
Reply-To: Max Euston <meuston@jmrodgers.com>
To: FreeBSD-gnats-submit@freebsd.org
Subject: more(1) '-#' broken (obsolete) and h)elp does not pause
X-Send-Pr-Version: 3.2

>Number:         5996
>Category:       bin
>Synopsis:       more(1) '-#' broken (obsolete) and h)elp does not pause
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    hoek
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar 13 13:50:00 PST 1998
>Closed-Date:    Sun Jul 26 09:28:21 PDT 1998
>Last-Modified:  Sun Jul 26 09:28:56 PDT 1998
>Originator:     Max Euston
>Release:        FreeBSD 2.2.5-STABLE i386
>Organization:
>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) {

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->hoek 
Responsible-Changed-By: hoek 
Responsible-Changed-When: Sat Jul 18 15:51:29 PDT 1998 
Responsible-Changed-Why:  
I accidentally fixed half of this earlier... 
State-Changed-From-To: open->closed 
State-Changed-By: hoek 
State-Changed-When: Sun Jul 26 09:28:21 PDT 1998 
State-Changed-Why:  
The patches have been applied in -current.  Thanks! 
>Unformatted:
