920aa7c
--- util-linux-2.13-pre2/text-utils/Makefile.am.moretc	2005-08-17 10:40:44.000000000 +0200
920aa7c
+++ util-linux-2.13-pre2/text-utils/Makefile.am	2005-08-17 10:41:52.000000000 +0200
169b953
@@ -7,16 +7,13 @@
169b953
 man_MANS = col.1 colcrt.1 colrm.1 column.1 hexdump.1 rev.1 line.1 tailf.1
169b953
 
169b953
 if HAVE_NCURSES
169b953
-bin_PROGRAMS = more
920aa7c
 usrbinexec_PROGRAMS += ul pg
169b953
-more_LDADD = -lncurses
169b953
 pg_LDADD = -lncurses
169b953
 ul_LDADD = -lncurses
169b953
-man_MANS += ul.1 more.1 pg.1
169b953
-else
169b953
+man_MANS += ul.1 pg.1
169b953
+endif
169b953
 if HAVE_TERMCAP
169b953
 bin_PROGRAMS = more
169b953
 more_LDADD = -ltermcap
169b953
 man_MANS += more.1
169b953
 endif
169b953
-endif
920aa7c
--- util-linux-2.13-pre2/text-utils/more.c.moretc	2005-07-28 23:49:31.000000000 +0200
920aa7c
+++ util-linux-2.13-pre2/text-utils/more.c	2005-08-17 10:40:23.000000000 +0200
169b953
@@ -59,6 +59,8 @@
169b953
 #include "nls.h"
169b953
 #include "widechar.h"
169b953
 
169b953
+#include "../config.h"
169b953
+
169b953
 #define _REGEX_RE_COMP
169b953
 #include <regex.h>
169b953
 #undef _REGEX_RE_COMP
169b953
@@ -165,19 +167,60 @@
169b953
 } context, screen_start;
169b953
 extern char	PC;		/* pad character */
169b953
 
169b953
+#ifdef HAVE_LIBTERMCAP
169b953
+
169b953
+#include <termcap.h>
169b953
+
169b953
+char termbuffer[4096];
169b953
+char tcbuffer[4096];
169b953
+char *strbuf = termbuffer;
169b953
+
169b953
+static void
169b953
+my_putstring(char *s) {
169b953
+     tputs (s, 1, putchar);
169b953
+}
169b953
+
169b953
+static void
169b953
+my_setupterm(const char *term, int fildes, int *errret) {
169b953
+     *errret = tgetent(tcbuffer, term);
169b953
+}
169b953
+
169b953
+static int
169b953
+my_tgetnum(char *s, char *ss) {
169b953
+     return tgetnum(s);
169b953
+}
169b953
+
169b953
+static int
169b953
+my_tgetflag(char *s, char *ss) {
169b953
+     return tgetflag(s);
169b953
+}
169b953
+
169b953
+static char *
169b953
+my_tgetstr(char *s, char *ss) {
169b953
+     return tgetstr(s, &strbuf);
169b953
+}
169b953
+
169b953
+static char *
169b953
+my_tgoto(const char *cap, int col, int row) {
169b953
+     return tgoto(cap, col, row);
169b953
+}
169b953
+
169b953
+#else /* !HAVE_TERMCAP */
169b953
+
169b953
 #ifdef HAVE_NCURSES_H
169b953
-#include <ncurses.h>
169b953
+# include <ncurses.h>
169b953
+# include <term.h>
169b953
 #elif defined(HAVE_NCURSES_NCURSES_H)
169b953
-#include <ncurses/ncurses.h>
169b953
+# include <ncurses/ncurses.h>
169b953
+# include <term.h>
169b953
 #endif
169b953
 
169b953
-#include <term.h>			/* include after <curses.h> */
169b953
-
169b953
 static void
169b953
 my_putstring(char *s) {
169b953
 	tputs (s, 1, putchar);		/* putp(s); */
169b953
 }
169b953
 
169b953
+
169b953
 static void
169b953
 my_setupterm(const char *term, int fildes, int *errret) {
169b953
      setupterm(term, fildes, errret);
169b953
@@ -203,6 +246,8 @@
169b953
      return tparm(cap, col, row);
169b953
 }
169b953
 
169b953
+#endif /* !HAVE_TERMCAP */
169b953
+
169b953
 static void
169b953
 idummy(int *kk) {}
169b953