#include <fcntl.h>
#include <signal.h>
#include <sys/ioctl.h>
+#define BB_DECLARE_EXTERN
+#define bb_need_help
+#include "messages.c"
-static const char more_usage[] = "more [file ...]\n";
+static const char more_usage[] = "more [FILE ...]\n"
+#ifndef BB_FEATURE_TRIVIAL_HELP
+ "\nMore is a filter for viewing FILE one screenful at a time.\n"
+#endif
+ ;
/* ED: sparc termios is broken: revert back to old termio handling. */
#ifdef BB_FEATURE_USE_TERMIOS
#endif
FILE *cin;
+
struct termios initial_settings, new_settings;
void gotsig(int sig)
#if defined BB_FEATURE_AUTOWIDTH
-static int terminal_width = 0, terminal_height = 0;
+#ifdef BB_FEATURE_USE_TERMIOS
+static int terminal_width = TERMINAL_WIDTH;
+#endif
+static int terminal_height = TERMINAL_HEIGHT;
#else
#define terminal_width TERMINAL_WIDTH
#define terminal_height TERMINAL_HEIGHT
struct stat st;
FILE *file;
-#ifdef BB_FEATURE_AUTOWIDTH
+#if defined BB_FEATURE_AUTOWIDTH && defined BB_FEATURE_USE_TERMIOS
struct winsize win = { 0, 0 };
#endif
argv++;
if (argc > 0
- && (strcmp(*argv, "--help") == 0 || strcmp(*argv, "-h") == 0)) {
+ && (strcmp(*argv, dash_dash_help) == 0 || strcmp(*argv, "-h") == 0)) {
usage(more_usage);
}
do {
);
fflush(stdout);
+#ifdef BB_FEATURE_USE_TERMIOS
input = getc(cin);
+#else
+ input = getc(stdin);
+#endif
#ifdef BB_FEATURE_USE_TERMIOS
/* Erase the "More" message */