summaryrefslogtreecommitdiff
path: root/distrib
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2003-05-28 19:11:35 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2003-05-28 19:11:35 +0000
commita0ca6a6cfa553a5da1bf690e0ac75385626e68e3 (patch)
tree8f2e9f2d349171403bcbc63cff5bc5426d3f2f65 /distrib
parent72c9520fbf427c5a6bee6ea0ef433796bb524f2a (diff)
help file incorporated, does not grow that much; millert@ ok
Diffstat (limited to 'distrib')
-rw-r--r--distrib/special/more/Makefile10
-rw-r--r--distrib/special/more/more.c20
-rw-r--r--distrib/special/more/pathnames.h38
3 files changed, 19 insertions, 49 deletions
diff --git a/distrib/special/more/Makefile b/distrib/special/more/Makefile
index 98ac18f3c58..94905136533 100644
--- a/distrib/special/more/Makefile
+++ b/distrib/special/more/Makefile
@@ -1,9 +1,15 @@
-# $OpenBSD: Makefile,v 1.2 2003/05/06 00:23:03 millert Exp $
+# $OpenBSD: Makefile,v 1.3 2003/05/28 19:11:34 mickey Exp $
PROG= more
MAN=
-CFLAGS+=-D_USE_OLD_CURSES_
+CFLAGS+=-D_USE_OLD_CURSES_ -I.
DPADD= ${LIBOCURSES}
LDADD= -locurses
+CLEANFILES+=morehelp.h
+
+beforedepend: morehelp.h
+
+morehelp.h: ${.CURDIR}/more.help
+ sed 's/\(^.*$$\)/\"\1\",/' ${.CURDIR}/more.help > morehelp.h
.include <bsd.prog.mk>
diff --git a/distrib/special/more/more.c b/distrib/special/more/more.c
index 0a805debbb0..350059cc6eb 100644
--- a/distrib/special/more/more.c
+++ b/distrib/special/more/more.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: more.c,v 1.10 2003/05/28 17:44:06 millert Exp $ */
+/* $OpenBSD: more.c,v 1.11 2003/05/28 19:11:34 mickey Exp $ */
/*-
* Copyright (c) 1980 The Regents of the University of California.
@@ -43,7 +43,7 @@ static const char copyright[] =
#if 0
static const char sccsid[] = "@(#)more.c 5.28 (Berkeley) 3/1/93";
#else
-static const char rcsid[] = "$OpenBSD: more.c,v 1.10 2003/05/28 17:44:06 millert Exp $";
+static const char rcsid[] = "$OpenBSD: more.c,v 1.11 2003/05/28 19:11:34 mickey Exp $";
#endif
#endif /* not lint */
@@ -76,8 +76,7 @@ static const char rcsid[] = "$OpenBSD: more.c,v 1.10 2003/05/28 17:44:06 millert
#include <string.h>
#include <termios.h>
#include <unistd.h>
-
-#include "pathnames.h"
+#include <paths.h>
#define Fopen(s,m) (Currline = 0, file_pos=0, fopen(s,m))
#define Ftell(f) (file_pos)
@@ -100,6 +99,11 @@ static const char rcsid[] = "$OpenBSD: more.c,v 1.10 2003/05/28 17:44:06 millert
#define DUM_ERROR "[Press 'h' for instructions.]"
#define QUIT_IT "[Use q or Q to quit]"
+const char *more_help[] = {
+#include "morehelp.h"
+ NULL
+};
+
struct termios otty, osavetty;
long file_pos, file_size;
int fnum, no_intty, no_tty, slow_tty;
@@ -892,9 +896,9 @@ command(char *filename, FILE *f)
int retval;
char c;
char colonch;
- FILE *helpf;
int done;
char comchar, cmdbuf[80], *p;
+ const char **q;
#define ret(val) retval=val;done++;break
@@ -1071,12 +1075,10 @@ command(char *filename, FILE *f)
break;
case '?':
case 'h':
- if ((helpf = fopen(HELPFILE, "r")) == NULL)
- error("Can't open help file");
if (noscroll)
doclear();
- copy_file(helpf);
- fclose(helpf);
+ for (q = more_help; *q; q++)
+ puts(*q);
prompt(filename);
break;
case 'v': /* This case should go right before default */
diff --git a/distrib/special/more/pathnames.h b/distrib/special/more/pathnames.h
deleted file mode 100644
index 296d60aba3e..00000000000
--- a/distrib/special/more/pathnames.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*-
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)pathnames.h 5.2 (Berkeley) 4/18/91
- */
-
-#include <paths.h>
-
-#define HELPFILE "/usr/share/misc/omore.help"