diff options
-rw-r--r-- | usr.bin/less/Makefile.bsd-wrapper | 19 | ||||
-rw-r--r-- | usr.bin/less/Makefile.in | 5 | ||||
-rw-r--r-- | usr.bin/less/ch.c | 12 | ||||
-rw-r--r-- | usr.bin/less/command.c | 44 | ||||
-rw-r--r-- | usr.bin/less/defines.h.in | 324 | ||||
-rw-r--r-- | usr.bin/less/edit.c | 23 | ||||
-rw-r--r-- | usr.bin/less/filename.c | 19 | ||||
-rw-r--r-- | usr.bin/less/forwback.c | 2 | ||||
-rw-r--r-- | usr.bin/less/funcs.h | 2 | ||||
-rw-r--r-- | usr.bin/less/help.c | 320 | ||||
-rw-r--r-- | usr.bin/less/less.h | 3 | ||||
-rw-r--r-- | usr.bin/less/main.c | 3 | ||||
-rw-r--r-- | usr.bin/less/mark.c | 2 | ||||
-rw-r--r-- | usr.bin/less/mkhelp.c | 69 | ||||
-rw-r--r-- | usr.bin/less/optfunc.c | 19 | ||||
-rw-r--r-- | usr.bin/less/opttbl.c | 9 | ||||
-rw-r--r-- | usr.bin/less/prompt.c | 4 |
17 files changed, 407 insertions, 472 deletions
diff --git a/usr.bin/less/Makefile.bsd-wrapper b/usr.bin/less/Makefile.bsd-wrapper index d79ba865396..8c18dbf9c38 100644 --- a/usr.bin/less/Makefile.bsd-wrapper +++ b/usr.bin/less/Makefile.bsd-wrapper @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.bsd-wrapper,v 1.19 2003/04/13 18:26:25 millert Exp $ +# $OpenBSD: Makefile.bsd-wrapper,v 1.20 2003/04/14 14:33:57 millert Exp $ # # less config @@ -7,6 +7,7 @@ PREFIX= /usr BINDIR= ${PREFIX}/bin DATADIR= ${PREFIX}/share/misc LIBS= -lcurses +LESS_HLP= more.help LINKS= ${BINDIR}/less ${BINDIR}/more ${BINDIR}/less ${BINDIR}/page MAN= less.1 lesskey.1 MLINKS= less.1 more.1 less.1 page.1 @@ -36,7 +37,7 @@ OBJS= main.o screen.o brac.o ch.o charset.o cmdbuf.o \ .SUFFIXES: .o .c .c.o: config.status @$(MAKE) ${XCFLAGS} LIBS=${LIBS} \ - datadir=${DATADIR} ${.TARGET} + datadir=${DATADIR} LESS_HLP=${LESS_HLP} ${.TARGET} .FORCE: .IGNORE @@ -53,25 +54,25 @@ config: .FORCE -rm -f config.cache .endif ${XCFLAGS} PATH="/bin:/usr/bin:/sbin:/usr/sbin" \ - INSTALL_PROGRAM="${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP}" \ + INSTALL_PROGRAM="${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP}" \ TERMLIBS=-lcurses /bin/sh ${.CURDIR}/configure \ --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc ${CF} config.status: ${XCFLAGS} PATH="/bin:/usr/bin:/sbin:/usr/sbin" \ - INSTALL_PROGRAM="${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP}" \ + INSTALL_PROGRAM="${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP}" \ TERMLIBS=-lcurses /bin/sh ${.CURDIR}/configure \ --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc ${CF} gnu_build: - ${MAKE} ${XCFLAGS} LIBS=${LIBS} datadir=${DATADIR} + ${MAKE} ${XCFLAGS} LIBS=${LIBS} datadir=${DATADIR} LESS_HLP=${LESS_HLP} .ifdef NOMAN maninstall: @echo NOMAN is set .endif -install: gnu_install maninstall _SUBDIRUSE +install: gnu_install maninstall afterinstall _SUBDIRUSE .if defined(LINKS) && !empty(LINKS) @set ${LINKS}; \ while test $$# -ge 2; do \ @@ -87,7 +88,7 @@ install: gnu_install maninstall _SUBDIRUSE gnu_install: ${MAKE} ${XCFLAGS} LIBS=${LIBS} \ - bindir=${DESTDIR}${BINDIR} \ + LESS_HLP=${LESS_HLP} bindir=${DESTDIR}${BINDIR} \ datadir=${DESTDIR}${PREFIX}/share/misc \ INSTALL_PROGRAM="${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}" \ INSTALL_DATA="${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 444" \ @@ -97,6 +98,10 @@ clean cleandir: rm -f ${CLEANFILES} -@if [ -e Makefile ]; then ${MAKE} distclean; fi +afterinstall: + ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} \ + ${.CURDIR}/less.hlp ${DESTDIR}${DATADIR}/${LESS_HLP} + # # Fix less manpage suffix # diff --git a/usr.bin/less/Makefile.in b/usr.bin/less/Makefile.in index 5a3d4e74aa9..57cd0104837 100644 --- a/usr.bin/less/Makefile.in +++ b/usr.bin/less/Makefile.in @@ -17,6 +17,8 @@ O=o LIBS = @LIBS@ +LESS_HLP=less.hlp + prefix = @prefix@ exec_prefix = @exec_prefix@ @@ -59,6 +61,9 @@ lessecho: lessecho.${O} version.${O} ${OBJ}: ${srcdir}/less.h ${srcdir}/funcs.h defines.h +filename.${O}: ${srcdir}/filename.c + ${CC} -I. ${CFLAGS_COMPILE_ONLY} -DHELPFILE=\"${datadir}/${LESS_HLP}\" ${CPPFLAGS} ${CFLAGS} ${srcdir}/filename.c + install: all ${srcdir}/lesskey.nro ${INSTALL_PROGRAM} less ${bindir}/${binprefix}less ${INSTALL_PROGRAM} lesskey ${bindir}/${binprefix}lesskey diff --git a/usr.bin/less/ch.c b/usr.bin/less/ch.c index 0446a2c2292..ca54da967cf 100644 --- a/usr.bin/less/ch.c +++ b/usr.bin/less/ch.c @@ -98,8 +98,6 @@ static int maxbufs = -1; extern int autobuf; extern int sigs; extern int secure; -extern constant char helpdata[]; -extern constant int size_helpdata; extern IFILE curr_ifile; #if LOGFILE extern int logfile; @@ -211,10 +209,6 @@ fch_get() bp->data[bp->datasize] = ch_ungotchar; n = 1; ch_ungotchar = -1; - } else if (ch_flags & CH_HELPFILE) - { - bp->data[bp->datasize] = helpdata[ch_fpos]; - n = 1; } else { n = iread(ch_file, &bp->data[bp->datasize], @@ -505,8 +499,6 @@ ch_length() { if (ignore_eoi) return (NULL_POSITION); - if (ch_flags & CH_HELPFILE) - return (size_helpdata); return (ch_fsize); } @@ -769,7 +761,7 @@ ch_close() { int keepstate = FALSE; - if (ch_flags & (CH_CANSEEK|CH_POPENED|CH_HELPFILE)) + if (ch_flags & (CH_CANSEEK|CH_POPENED)) { /* * We can seek or re-open, so we don't need to keep buffers. @@ -785,7 +777,7 @@ ch_close() * But don't really close it if it was opened via popen(), * because pclose() wants to close it. */ - if (!(ch_flags & (CH_POPENED|CH_HELPFILE))) + if (!(ch_flags & CH_POPENED)) close(ch_file); ch_file = -1; } else diff --git a/usr.bin/less/command.c b/usr.bin/less/command.c index 587dbc4fa25..1aea3386561 100644 --- a/usr.bin/less/command.c +++ b/usr.bin/less/command.c @@ -33,6 +33,7 @@ extern int swindow; extern int jump_sline; extern int quitting; extern int wscroll; +extern int nohelp; extern int top_scroll; extern int ignore_eoi; extern int secure; @@ -603,8 +604,7 @@ prompt() * If the -E flag is set and we've hit EOF on the last file, quit. */ if ((quit_at_eof == OPT_ONPLUS || quit_if_one_screen) && - hit_eof && !(ch_getflags() & CH_HELPFILE) && - next_ifile(curr_ifile) == NULL_IFILE) + hit_eof && next_ifile(curr_ifile) == NULL_IFILE) quit(QUIT_OK); quit_if_one_screen = FALSE; #if 0 /* This doesn't work well because some "te"s clear the screen. */ @@ -617,13 +617,6 @@ prompt() quit(QUIT_OK); #endif -#if MSDOS_COMPILER==WIN32C - /* - * In Win32, display the file name in the window title. - */ - if (!(ch_getflags() & CH_HELPFILE)) - SetConsoleTitle(pr_expand("Less?f - %f.", 0)); -#endif /* * Select the proper prompt and display it. */ @@ -1079,8 +1072,6 @@ commands() /* * Forward forever, ignoring EOF. */ - if (ch_getflags() & CH_HELPFILE) - break; cmd_exec(); jump_forw(); ignore_eoi = 1; @@ -1189,8 +1180,6 @@ commands() /* * Print file name, etc. */ - if (ch_getflags() & CH_HELPFILE) - break; cmd_exec(); parg.p_string = eq_message(); error("%s", &parg); @@ -1208,17 +1197,6 @@ commands() /* * Exit. */ - if (curr_ifile != NULL_IFILE && - ch_getflags() & CH_HELPFILE) - { - /* - * Quit while viewing the help file - * just means return to viewing the - * previous file. - */ - if (edit_prev(1) == 0) - break; - } if (extra != NULL) quit(*extra); quit(QUIT_OK); @@ -1302,10 +1280,15 @@ commands() /* * Help. */ - if (ch_getflags() & CH_HELPFILE) + if (nohelp) + { + bell(); break; + } + clear_bot(); + putstr(" help"); cmd_exec(); - (void) edit(FAKE_HELPFILE); + help(0); break; case A_EXAMINE: @@ -1336,8 +1319,6 @@ commands() error("Command not available", NULL_PARG); break; } - if (ch_getflags() & CH_HELPFILE) - break; if (strcmp(get_filename(curr_ifile), "-") == 0) { error("Cannot edit standard input", NULL_PARG); @@ -1380,8 +1361,7 @@ commands() number = 1; if (edit_next((int) number)) { - if (quit_at_eof && hit_eof && - !(ch_getflags() & CH_HELPFILE)) + if (quit_at_eof && hit_eof) quit(QUIT_OK); parg.p_string = (number > 1) ? "(N-th) " : ""; error("No %snext file", &parg); @@ -1461,8 +1441,6 @@ commands() break; case A_REMOVE_FILE: - if (ch_getflags() & CH_HELPFILE) - break; old_ifile = curr_ifile; new_ifile = getoff_ifile(curr_ifile); if (new_ifile == NULL_IFILE) @@ -1525,8 +1503,6 @@ commands() /* * Set a mark. */ - if (ch_getflags() & CH_HELPFILE) - break; start_mca(A_SETMARK, "mark: ", (void*)NULL, 0); c = getcc(); if (c == erase_char || c == kill_char || diff --git a/usr.bin/less/defines.h.in b/usr.bin/less/defines.h.in index 113ecee2b35..3cc163f7ec8 100644 --- a/usr.bin/less/defines.h.in +++ b/usr.bin/less/defines.h.in @@ -1,4 +1,6 @@ -/* defines.h.in. Generated automatically from configure.in by autoheader. */ +/* defines.h.in. Generated from configure.ac by autoheader. */ + + /* Unix definition file for less. -*- C -*- * * This file has 3 sections: @@ -10,7 +12,7 @@ * If you edit defines.h by hand, do "touch stamp-h" before you run make * so config.status doesn't overwrite your changes. */ - + /* User preferences. */ /* @@ -20,27 +22,35 @@ #define SECURE 0 /* + * SMALL is 1 if you wish to disable a bunch of features in order to + * build a smaller less binary. + */ +#ifndef SMALL +#define SMALL 0 +#endif + +/* * SHELL_ESCAPE is 1 if you wish to allow shell escapes. * (This is possible only if your system supplies the system() function.) */ -#define SHELL_ESCAPE (!SECURE) +#define SHELL_ESCAPE (!SECURE && !SMALL) /* * EXAMINE is 1 if you wish to allow examining files by name from within less. */ -#define EXAMINE (!SECURE) +#define EXAMINE (!SECURE && !SMALL) /* * TAB_COMPLETE_FILENAME is 1 if you wish to allow the TAB key * to complete filenames at prompts. */ -#define TAB_COMPLETE_FILENAME (!SECURE) +#define TAB_COMPLETE_FILENAME (!SECURE && !SMALL) /* * CMD_HISTORY is 1 if you wish to allow keys to cycle through * previous commands at prompts. */ -#define CMD_HISTORY 1 +#define CMD_HISTORY (!SMALL) /* * HILITE_SEARCH is 1 if you wish to have search targets to be @@ -53,43 +63,42 @@ * (This is possible only if your system supplies the system() function.) * EDIT_PGM is the name of the (default) editor to be invoked. */ -#define EDITOR (!SECURE) -#define EDIT_PGM "vi" +#define EDITOR (!SECURE && !SMALL) /* * TAGS is 1 if you wish to support tag files. */ -#define TAGS (!SECURE) +#define TAGS (!SECURE && !SMALL) /* * USERFILE is 1 if you wish to allow a .less file to specify * user-defined key bindings. */ -#define USERFILE (!SECURE) +#define USERFILE (!SECURE && !SMALL) /* * GLOB is 1 if you wish to have shell metacharacters expanded in filenames. * This will generally work if your system provides the "popen" function * and the "echo" shell command. */ -#define GLOB (!SECURE) +#define GLOB (!SECURE && !SMALL) /* * PIPEC is 1 if you wish to have the "|" command * which allows the user to pipe data into a shell command. */ -#define PIPEC (!SECURE) +#define PIPEC (!SECURE && !SMALL) /* * LOGFILE is 1 if you wish to allow the -l option (to create log files). */ -#define LOGFILE (!SECURE) +#define LOGFILE (!SECURE && !SMALL) /* * GNU_OPTIONS is 1 if you wish to support the GNU-style command * line options --help and --version. */ -#define GNU_OPTIONS 1 +#define GNU_OPTIONS (!SMALL) /* * ONLY_RETURN is 1 if you want RETURN to be the only input which @@ -101,19 +110,26 @@ /* * LESSKEYFILE is the filename of the default lesskey output file * (in the HOME directory). + * LESSKEYFILE_SYS is the filename of the system-wide lesskey output file. * DEF_LESSKEYINFILE is the filename of the default lesskey input * (in the HOME directory). */ #define LESSKEYFILE ".less" +#define LESSKEYFILE_SYS SYSDIR "/sysless" #define DEF_LESSKEYINFILE ".lesskey" - + /* Settings always true on Unix. */ /* - * Define MSOFTC if compiling under Microsoft C. + * Define MSDOS_COMPILER if compiling under Microsoft C. + */ +#define MSDOS_COMPILER 0 + +/* + * Pathname separator character. */ -#define MSOFTC 0 +#define PATHNAME_SEP "/" /* * HAVE_SYS_TYPES_H is 1 if your system has <sys/types.h>. @@ -121,9 +137,9 @@ #define HAVE_SYS_TYPES_H 1 /* - * HAVE_STAT is 1 if your system has the stat() call. + * Define if you have the <sgstat.h> header file. */ -#define HAVE_STAT 1 +#undef HAVE_SGSTAT_H /* * HAVE_PERROR is 1 if your system has the perror() call. @@ -140,128 +156,248 @@ * HAVE_SHELL is 1 if your system supports a SHELL command interpreter. */ #define HAVE_SHELL 1 - -/* Settings automatically determined by configure. */ - -/* Define to `long' if <sys/types.h> doesn't define. */ -#undef off_t - -/* Define if you need to in order for stat and other things to work. */ -#undef _POSIX_SOURCE -/* Define as the return type of signal handlers (int or void). */ -#undef RETSIGTYPE +/* + * Default shell metacharacters and meta-escape character. + */ +#define DEF_METACHARS "; *?\t\n'\"()<>|&^`#\\" +#define DEF_METAESCAPE "\\" -/* Define if you have the ANSI C header files. */ -#undef STDC_HEADERS +/* + * HAVE_DUP is 1 if your system has the dup() call. + */ +#define HAVE_DUP 1 /* - * Regular expression library. - * Define exactly one of the following to be 1: - * HAVE_POSIX_REGCOMP: POSIX regcomp() and regex.h - * HAVE_RE_COMP: BSD re_comp() - * HAVE_REGCMP: System V regcmp() - * HAVE_V8_REGCOMP: Henry Spencer V8 regcomp() and regexp.h - * NO_REGEX: pattern matching is supported, but without metacharacters. + * Sizes of various buffers. */ -#undef HAVE_POSIX_REGCOMP -#undef HAVE_RE_COMP -#undef HAVE_REGCMP -#undef HAVE_V8_REGCOMP -#undef NO_REGEX +#define CMDBUF_SIZE 512 /* Buffer for multichar commands */ +#define UNGOT_SIZE 100 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 200 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 512 /* Max size of line in tags file */ +#define TABSTOP_MAX 32 /* Max number of custom tab stops */ -/* Define HAVE_VOID if your compiler supports the "void" type. */ -#undef HAVE_VOID +/* Settings automatically determined by configure. */ -/* Define HAVE_TIME_T if your system supports the "time_t" type. */ -#undef HAVE_TIME_T -/* Define HAVE_STRERROR if you have the strerror() function. */ -#undef HAVE_STRERROR +/* Define EDIT_PGM to your editor. */ +#undef EDIT_PGM + +/* Define HAVE_CONST if your compiler supports the "const" modifier. */ +#undef HAVE_CONST + +/* Define to 1 if you have the <ctype.h> header file. */ +#undef HAVE_CTYPE_H + +/* Define HAVE_ERRNO if you have the errno variable. */ +#undef HAVE_ERRNO + +/* Define to 1 if you have the <errno.h> header file. */ +#undef HAVE_ERRNO_H + +/* Define to 1 if you have the <fcntl.h> header file. */ +#undef HAVE_FCNTL_H /* Define HAVE_FILENO if you have the fileno() macro. */ #undef HAVE_FILENO -/* Define HAVE_ERRNO if you have the errno variable */ -#undef HAVE_ERRNO +/* Define to 1 if you have the `fsync' function. */ +#undef HAVE_FSYNC -/* Define HAVE_SYS_ERRLIST if you have the sys_errlist[] variable */ -#undef HAVE_SYS_ERRLIST +/* Define to 1 if you have the <inttypes.h> header file. */ +#undef HAVE_INTTYPES_H -/* Define HAVE_OSPEED if your termcap library has the ospeed variable */ -#undef HAVE_OSPEED -/* Define MUST_DEFINE_OSPEED if you have ospeed but it is not defined - * in termcap.h. */ -#undef MUST_DEFINE_OSPEED +/* Define to 1 if you have the `gen' library (-lgen). */ +#undef HAVE_LIBGEN + +/* Define to 1 if you have the `intl' library (-lintl). */ +#undef HAVE_LIBINTL + +/* Define to 1 if you have the `PW' library (-lPW). */ +#undef HAVE_LIBPW + +/* Define to 1 if you have the <limits.h> header file. */ +#undef HAVE_LIMITS_H /* Define HAVE_LOCALE if you have locale.h and setlocale. */ #undef HAVE_LOCALE -/* Define HAVE_TERMIOS_FUNCS if you have tcgetattr/tcsetattr */ -#undef HAVE_TERMIOS_FUNCS +/* Define to 1 if you have the `memcpy' function. */ +#undef HAVE_MEMCPY -/* Define HAVE_UPPER_LOWER if you have isupper, islower, toupper, tolower */ -#undef HAVE_UPPER_LOWER +/* Define to 1 if you have the <memory.h> header file. */ +#undef HAVE_MEMORY_H -/* Define if you have the _setjmp function. */ -#undef HAVE__SETJMP +/* Define HAVE_OSPEED if your termcap library has the ospeed variable. */ +#undef HAVE_OSPEED -/* Define if you have the memcpy function. */ -#undef HAVE_MEMCPY +/* PCRE (Perl-compatible regular expression) library */ +#undef HAVE_PCRE + +/* Define to 1 if you have the `popen' function. */ +#undef HAVE_POPEN + +/* POSIX regcomp() and regex.h */ +#undef HAVE_POSIX_REGCOMP + +/* System V regcmp() */ +#undef HAVE_REGCMP -/* Define if you have the sigsetmask function. */ +/* */ +#undef HAVE_REGEXEC2 + +/* BSD re_comp() */ +#undef HAVE_RE_COMP + +/* Define HAVE_SIGEMPTYSET if you have the sigemptyset macro. */ +#undef HAVE_SIGEMPTYSET + +/* Define to 1 if you have the `sigprocmask' function. */ +#undef HAVE_SIGPROCMASK + +/* Define to 1 if you have the `sigsetmask' function. */ #undef HAVE_SIGSETMASK -/* Define if you have the strchr function. */ +/* Define HAVE_SIGSET_T you have the sigset_t type. */ +#undef HAVE_SIGSET_T + +/* Define to 1 if you have the `stat' function. */ +#undef HAVE_STAT + +/* Define to 1 if you have the <stdint.h> header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the <stdio.h> header file. */ +#undef HAVE_STDIO_H + +/* Define to 1 if you have the <stdlib.h> header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR -/* Define if you have the system function. */ -#undef HAVE_SYSTEM +/* Define HAVE_STRERROR if you have the strerror() function. */ +#undef HAVE_STRERROR -/* Define if you have the <ctype.h> header file. */ -#undef HAVE_CTYPE_H +/* Define to 1 if you have the <strings.h> header file. */ +#undef HAVE_STRINGS_H -/* Define if you have the <errno.h> header file. */ -#undef HAVE_ERRNO_H +/* Define to 1 if you have the <string.h> header file. */ +#undef HAVE_STRING_H -/* Define if you have the <fcntl.h> header file. */ -#undef HAVE_FCNTL_H +/* Define to 1 if you have the `strstr' function. */ +#undef HAVE_STRSTR -/* Define if you have the <stdio.h> header file. */ -#undef HAVE_STDIO_H +/* Define to 1 if you have the `system' function. */ +#undef HAVE_SYSTEM + +/* Define HAVE_SYS_ERRLIST if you have the sys_errlist[] variable. */ +#undef HAVE_SYS_ERRLIST -/* Define if you have the <sys/ioctl.h> header file. */ +/* Define to 1 if you have the <sys/ioctl.h> header file. */ #undef HAVE_SYS_IOCTL_H -/* Define if you have the <sys/ptem.h> header file. */ +/* Define to 1 if you have the <sys/ptem.h> header file. */ #undef HAVE_SYS_PTEM_H -/* Define if you have the <sys/stream.h> header file. */ +/* Define to 1 if you have the <sys/stat.h> header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the <sys/stream.h> header file. */ #undef HAVE_SYS_STREAM_H -/* Define if you have the <termcap.h> header file. */ +/* Define to 1 if you have the <sys/types.h> header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the <termcap.h> header file. */ #undef HAVE_TERMCAP_H -/* Define if you have the <termio.h> header file. */ -#undef HAVE_TERMIO_H +/* Define HAVE_TERMIOS_FUNCS if you have tcgetattr/tcsetattr. */ +#undef HAVE_TERMIOS_FUNCS -/* Define if you have the <termios.h> header file. */ +/* Define to 1 if you have the <termios.h> header file. */ #undef HAVE_TERMIOS_H -/* Define if you have the <time.h> header file. */ +/* Define to 1 if you have the <termio.h> header file. */ +#undef HAVE_TERMIO_H + +/* Define to 1 if you have the <time.h> header file. */ #undef HAVE_TIME_H -/* Define if you have the <unistd.h> header file. */ +/* Define HAVE_TIME_T if your system supports the "time_t" type. */ +#undef HAVE_TIME_T + +/* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H -/* Define if you have the <values.h> header file. */ +/* Define HAVE_UPPER_LOWER if you have isupper, islower, toupper, tolower. */ +#undef HAVE_UPPER_LOWER + +/* Henry Spencer V8 regcomp() and regexp.h */ +#undef HAVE_V8_REGCOMP + +/* Define to 1 if you have the <values.h> header file. */ #undef HAVE_VALUES_H -/* Define if you have the PW library (-lPW). */ -#undef HAVE_LIBPW +/* Define HAVE_VOID if your compiler supports the "void" type. */ +#undef HAVE_VOID -/* Define if you have the gen library (-lgen). */ -#undef HAVE_LIBGEN +/* Define to 1 if you have the `_setjmp' function. */ +#undef HAVE__SETJMP -/* Define if you have the intl library (-lintl). */ -#undef HAVE_LIBINTL +/* Define MUST_DEFINE_ERRNO if you have errno but it is not define in errno.h. + */ +#undef MUST_DEFINE_ERRNO + +/* Define MUST_DEFINE_OSPEED if you have ospeed but it is not defined in + termcap.h. */ +#undef MUST_DEFINE_OSPEED + +/* pattern matching is supported, but without metacharacters. */ +#undef NO_REGEX + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define as the return type of signal handlers (`int' or `void'). */ +#undef RETSIGTYPE + +/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */ +#undef STAT_MACROS_BROKEN + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ +#undef TIME_WITH_SYS_TIME + +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS + +/* Define for large files, on AIX-style hosts. */ +#undef _LARGE_FILES + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `long' if <sys/types.h> does not define. */ +#undef off_t + +/* Define to `unsigned' if <sys/types.h> does not define. */ +#undef size_t diff --git a/usr.bin/less/edit.c b/usr.bin/less/edit.c index 4873c1f212d..bc0eca8dd3e 100644 --- a/usr.bin/less/edit.c +++ b/usr.bin/less/edit.c @@ -237,14 +237,6 @@ edit_ifile(ifile) { chflags = ch_getflags(); close_file(); - if ((chflags & CH_HELPFILE) && held_ifile(was_curr_ifile) <= 1) - { - /* - * Don't keep the help file in the ifile list. - */ - del_ifile(was_curr_ifile); - was_curr_ifile = old_ifile; - } } if (ifile == NULL_IFILE) @@ -299,10 +291,6 @@ edit_ifile(ifile) */ __djgpp_set_ctrl_c(1); #endif - } else if (strcmp(open_filename, FAKE_HELPFILE) == 0) - { - f = -1; - chflags |= CH_HELPFILE; } else if ((parg.p_string = bad_file(open_filename)) != NULL) { /* @@ -371,15 +359,12 @@ edit_ifile(ifile) new_file = TRUE; ch_init(f, chflags); - if (!(chflags & CH_HELPFILE)) - { #if LOGFILE - if (namelogfile != NULL && is_tty) - use_logfile(namelogfile); + if (namelogfile != NULL && is_tty) + use_logfile(namelogfile); #endif - if (every_first_cmd != NULL) - ungetsc(every_first_cmd); - } + if (every_first_cmd != NULL) + ungetsc(every_first_cmd); no_display = !any_display; flush(); diff --git a/usr.bin/less/filename.c b/usr.bin/less/filename.c index 8f136a97265..a46df09e77e 100644 --- a/usr.bin/less/filename.c +++ b/usr.bin/less/filename.c @@ -302,6 +302,25 @@ homefile(filename) return (NULL); } +#ifdef HELPFILE +/* + * Find out where the help file is. + */ + public char * +find_helpfile() +{ + char *helpfile; + + if ((helpfile = getenv("LESSHELP")) != NULL && *helpfile != '\0') + return (save(helpfile)); +#if MSDOS_COMPILER || OS2 + return (homefile(HELPFILE)); +#else + return (save(HELPFILE)); +#endif +} +#endif + /* * Expand a string, substituting any "%" with the current filename, * and any "#" with the previous filename. diff --git a/usr.bin/less/forwback.c b/usr.bin/less/forwback.c index 29a52bff90a..3f739d77422 100644 --- a/usr.bin/less/forwback.c +++ b/usr.bin/less/forwback.c @@ -331,7 +331,7 @@ forward(n, force, only_last) { POSITION pos; - if (quit_at_eof && hit_eof && !(ch_getflags() & CH_HELPFILE)) + if (quit_at_eof && hit_eof) { /* * If the -e flag is set and we're trying to go diff --git a/usr.bin/less/funcs.h b/usr.bin/less/funcs.h index 01b6c12a87a..4ee00d493f6 100644 --- a/usr.bin/less/funcs.h +++ b/usr.bin/less/funcs.h @@ -100,6 +100,7 @@ public char * get_meta_escape (); public char * shell_quote (); public char * homefile (); + public char * find_helpfile (); public char * fexpand (); public char * fcomplete (); public int bin_file (); @@ -115,6 +116,7 @@ public void forward (); public void backward (); public int get_back_scroll (); + public void help (); public void del_ifile (); public IFILE next_ifile (); public IFILE prev_ifile (); diff --git a/usr.bin/less/help.c b/usr.bin/less/help.c index 11e4b978b78..c813744c6a0 100644 --- a/usr.bin/less/help.c +++ b/usr.bin/less/help.c @@ -1,225 +1,95 @@ -/* This file was generated by mkhelp from less.hlp */ -#include "less.h" -constant char helpdata[] = { -'\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','\b','S','U','\b','U','M','\b','M','M','\b','M','A','\b','A','R','\b','R','Y','\b','Y',' ','O','\b','O','F','\b','F',' ','C','\b','C','O','\b','O','M','\b','M','M','\b','M','A','\b','A','N','\b','N','D','\b','D','S','\b','S','\n', -'\n', -' ',' ',' ',' ',' ',' ','C','o','m','m','a','n','d','s',' ','m','a','r','k','e','d',' ','w','i','t','h',' ','*',' ','m','a','y',' ','b','e',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','a',' ','n','u','m','b','e','r',',',' ','_','\b','N','.','\n', -' ',' ',' ',' ',' ',' ','N','o','t','e','s',' ','i','n',' ','p','a','r','e','n','t','h','e','s','e','s',' ','i','n','d','i','c','a','t','e',' ','t','h','e',' ','b','e','h','a','v','i','o','r',' ','i','f',' ','_','\b','N',' ','i','s',' ','g','i','v','e','n','.','\n', -'\n', -' ',' ','h',' ',' ','H',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','i','s','p','l','a','y',' ','t','h','i','s',' ','h','e','l','p','.','\n', -' ',' ','q',' ',' ',':','q',' ',' ','Q',' ',' ',':','Q',' ',' ','Z','Z',' ',' ',' ',' ',' ','E','x','i','t','.','\n', -' ','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\n', -'\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','M','\b','M','O','\b','O','V','\b','V','I','\b','I','N','\b','N','G','\b','G','\n', -'\n', -' ',' ','e',' ',' ','^','E',' ',' ','j',' ',' ','^','N',' ',' ','C','R',' ',' ','*',' ',' ','F','o','r','w','a','r','d',' ',' ','o','n','e',' ','l','i','n','e',' ',' ',' ','(','o','r',' ','_','\b','N',' ','l','i','n','e','s',')','.','\n', -' ',' ','y',' ',' ','^','Y',' ',' ','k',' ',' ','^','K',' ',' ','^','P',' ',' ','*',' ',' ','B','a','c','k','w','a','r','d',' ','o','n','e',' ','l','i','n','e',' ',' ',' ','(','o','r',' ','_','\b','N',' ','l','i','n','e','s',')','.','\n', -' ',' ','f',' ',' ','^','F',' ',' ','^','V',' ',' ','S','P','A','C','E',' ',' ','*',' ',' ','F','o','r','w','a','r','d',' ',' ','o','n','e',' ','w','i','n','d','o','w',' ','(','o','r',' ','_','\b','N',' ','l','i','n','e','s',')','.','\n', -' ',' ','b',' ',' ','^','B',' ',' ','E','S','C','-','v',' ',' ',' ',' ',' ',' ','*',' ',' ','B','a','c','k','w','a','r','d',' ','o','n','e',' ','w','i','n','d','o','w',' ','(','o','r',' ','_','\b','N',' ','l','i','n','e','s',')','.','\n', -' ',' ','z',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','F','o','r','w','a','r','d',' ',' ','o','n','e',' ','w','i','n','d','o','w',' ','(','a','n','d',' ','s','e','t',' ','w','i','n','d','o','w',' ','t','o',' ','_','\b','N',')','.','\n', -' ',' ','w',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','B','a','c','k','w','a','r','d',' ','o','n','e',' ','w','i','n','d','o','w',' ','(','a','n','d',' ','s','e','t',' ','w','i','n','d','o','w',' ','t','o',' ','_','\b','N',')','.','\n', -' ',' ','E','S','C','-','S','P','A','C','E',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','F','o','r','w','a','r','d',' ',' ','o','n','e',' ','w','i','n','d','o','w',',',' ','b','u','t',' ','d','o','n','\'','t',' ','s','t','o','p',' ','a','t',' ','e','n','d','-','o','f','-','f','i','l','e','.','\n', -' ',' ','d',' ',' ','^','D',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','F','o','r','w','a','r','d',' ',' ','o','n','e',' ','h','a','l','f','-','w','i','n','d','o','w',' ','(','a','n','d',' ','s','e','t',' ','h','a','l','f','-','w','i','n','d','o','w',' ','t','o',' ','_','\b','N',')','.','\n', -' ',' ','u',' ',' ','^','U',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','B','a','c','k','w','a','r','d',' ','o','n','e',' ','h','a','l','f','-','w','i','n','d','o','w',' ','(','a','n','d',' ','s','e','t',' ','h','a','l','f','-','w','i','n','d','o','w',' ','t','o',' ','_','\b','N',')','.','\n', -' ',' ','E','S','C','-',')',' ',' ','R','i','g','h','t','A','r','r','o','w',' ','*',' ',' ','L','e','f','t',' ',' ','o','n','e',' ','h','a','l','f',' ','s','c','r','e','e','n',' ','w','i','d','t','h',' ','(','o','r',' ','_','\b','N',' ','p','o','s','i','t','i','o','n','s',')','.','\n', -' ',' ','E','S','C','-','(',' ',' ','L','e','f','t','A','r','r','o','w',' ',' ','*',' ',' ','R','i','g','h','t',' ','o','n','e',' ','h','a','l','f',' ','s','c','r','e','e','n',' ','w','i','d','t','h',' ','(','o','r',' ','_','\b','N',' ','p','o','s','i','t','i','o','n','s',')','.','\n', -' ',' ','F',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','F','o','r','w','a','r','d',' ','f','o','r','e','v','e','r',';',' ','l','i','k','e',' ','"','t','a','i','l',' ','-','f','"','.','\n', -' ',' ','r',' ',' ','^','R',' ',' ','^','L',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','R','e','p','a','i','n','t',' ','s','c','r','e','e','n','.','\n', -' ',' ','R',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','R','e','p','a','i','n','t',' ','s','c','r','e','e','n',',',' ','d','i','s','c','a','r','d','i','n','g',' ','b','u','f','f','e','r','e','d',' ','i','n','p','u','t','.','\n', -' ',' ',' ',' ',' ',' ',' ',' ','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\n', -' ',' ',' ',' ',' ',' ',' ',' ','D','e','f','a','u','l','t',' ','"','w','i','n','d','o','w','"',' ','i','s',' ','t','h','e',' ','s','c','r','e','e','n',' ','h','e','i','g','h','t','.','\n', -' ',' ',' ',' ',' ',' ',' ',' ','D','e','f','a','u','l','t',' ','"','h','a','l','f','-','w','i','n','d','o','w','"',' ','i','s',' ','h','a','l','f',' ','o','f',' ','t','h','e',' ','s','c','r','e','e','n',' ','h','e','i','g','h','t','.','\n', -' ','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\n', -'\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','\b','S','E','\b','E','A','\b','A','R','\b','R','C','\b','C','H','\b','H','I','\b','I','N','\b','N','G','\b','G','\n', -'\n', -' ',' ','/','_','\b','p','_','\b','a','_','\b','t','_','\b','t','_','\b','e','_','\b','r','_','\b','n',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','S','e','a','r','c','h',' ','f','o','r','w','a','r','d',' ','f','o','r',' ','(','_','\b','N','-','t','h',')',' ','m','a','t','c','h','i','n','g',' ','l','i','n','e','.','\n', -' ',' ','?','_','\b','p','_','\b','a','_','\b','t','_','\b','t','_','\b','e','_','\b','r','_','\b','n',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','S','e','a','r','c','h',' ','b','a','c','k','w','a','r','d',' ','f','o','r',' ','(','_','\b','N','-','t','h',')',' ','m','a','t','c','h','i','n','g',' ','l','i','n','e','.','\n', -' ',' ','n',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','R','e','p','e','a','t',' ','p','r','e','v','i','o','u','s',' ','s','e','a','r','c','h',' ','(','f','o','r',' ','_','\b','N','-','t','h',' ','o','c','c','u','r','r','e','n','c','e',')','.','\n', -' ',' ','N',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','R','e','p','e','a','t',' ','p','r','e','v','i','o','u','s',' ','s','e','a','r','c','h',' ','i','n',' ','r','e','v','e','r','s','e',' ','d','i','r','e','c','t','i','o','n','.','\n', -' ',' ','E','S','C','-','n',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','R','e','p','e','a','t',' ','p','r','e','v','i','o','u','s',' ','s','e','a','r','c','h',',',' ','s','p','a','n','n','i','n','g',' ','f','i','l','e','s','.','\n', -' ',' ','E','S','C','-','N',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','R','e','p','e','a','t',' ','p','r','e','v','i','o','u','s',' ','s','e','a','r','c','h',',',' ','r','e','v','e','r','s','e',' ','d','i','r','.',' ','&',' ','s','p','a','n','n','i','n','g',' ','f','i','l','e','s','.','\n', -' ',' ','E','S','C','-','u',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','U','n','d','o',' ','(','t','o','g','g','l','e',')',' ','s','e','a','r','c','h',' ','h','i','g','h','l','i','g','h','t','i','n','g','.','\n', -' ',' ',' ',' ',' ',' ',' ',' ','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\n', -' ',' ',' ',' ',' ',' ',' ',' ','S','e','a','r','c','h',' ','p','a','t','t','e','r','n','s',' ','m','a','y',' ','b','e',' ','m','o','d','i','f','i','e','d',' ','b','y',' ','o','n','e',' ','o','r',' ','m','o','r','e',' ','o','f',':','\n', -' ',' ',' ',' ',' ',' ',' ',' ','^','N',' ','o','r',' ','!',' ',' ','S','e','a','r','c','h',' ','f','o','r',' ','N','O','N','-','m','a','t','c','h','i','n','g',' ','l','i','n','e','s','.','\n', -' ',' ',' ',' ',' ',' ',' ',' ','^','E',' ','o','r',' ','*',' ',' ','S','e','a','r','c','h',' ','m','u','l','t','i','p','l','e',' ','f','i','l','e','s',' ','(','p','a','s','s',' ','t','h','r','u',' ','E','N','D',' ','O','F',' ','F','I','L','E',')','.','\n', -' ',' ',' ',' ',' ',' ',' ',' ','^','F',' ','o','r',' ','@',' ',' ','S','t','a','r','t',' ','s','e','a','r','c','h',' ','a','t',' ','F','I','R','S','T',' ','f','i','l','e',' ','(','f','o','r',' ','/',')',' ','o','r',' ','l','a','s','t',' ','f','i','l','e',' ','(','f','o','r',' ','?',')','.','\n', -' ',' ',' ',' ',' ',' ',' ',' ','^','K',' ',' ',' ',' ',' ',' ',' ','H','i','g','h','l','i','g','h','t',' ','m','a','t','c','h','e','s',',',' ','b','u','t',' ','d','o','n','\'','t',' ','m','o','v','e',' ','(','K','E','E','P',' ','p','o','s','i','t','i','o','n',')','.','\n', -' ',' ',' ',' ',' ',' ',' ',' ','^','R',' ',' ',' ',' ',' ',' ',' ','D','o','n','\'','t',' ','u','s','e',' ','R','E','G','U','L','A','R',' ','E','X','P','R','E','S','S','I','O','N','S','.','\n', -' ','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\n', -'\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','J','\b','J','U','\b','U','M','\b','M','P','\b','P','I','\b','I','N','\b','N','G','\b','G','\n', -'\n', -' ',' ','g',' ',' ','<',' ',' ','E','S','C','-','<',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','G','o',' ','t','o',' ','f','i','r','s','t',' ','l','i','n','e',' ','i','n',' ','f','i','l','e',' ','(','o','r',' ','l','i','n','e',' ','_','\b','N',')','.','\n', -' ',' ','G',' ',' ','>',' ',' ','E','S','C','-','>',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','G','o',' ','t','o',' ','l','a','s','t',' ','l','i','n','e',' ','i','n',' ','f','i','l','e',' ','(','o','r',' ','l','i','n','e',' ','_','\b','N',')','.','\n', -' ',' ','p',' ',' ','%',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','G','o',' ','t','o',' ','b','e','g','i','n','n','i','n','g',' ','o','f',' ','f','i','l','e',' ','(','o','r',' ','_','\b','N',' ','p','e','r','c','e','n','t',' ','i','n','t','o',' ','f','i','l','e',')','.','\n', -' ',' ','t',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','G','o',' ','t','o',' ','t','h','e',' ','(','_','\b','N','-','t','h',')',' ','n','e','x','t',' ','t','a','g','.','\n', -' ',' ','T',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','G','o',' ','t','o',' ','t','h','e',' ','(','_','\b','N','-','t','h',')',' ','p','r','e','v','i','o','u','s',' ','t','a','g','.','\n', -' ',' ','{',' ',' ','(',' ',' ','[',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','F','i','n','d',' ','c','l','o','s','e',' ','b','r','a','c','k','e','t',' ','}',' ',')',' ',']','.','\n', -' ',' ','}',' ',' ',')',' ',' ',']',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','F','i','n','d',' ','o','p','e','n',' ','b','r','a','c','k','e','t',' ','{',' ','(',' ','[','.','\n', -' ',' ','E','S','C','-','^','F',' ','_','\b','<','_','\b','c','_','\b','1','_','\b','>',' ','_','\b','<','_','\b','c','_','\b','2','_','\b','>',' ',' ','*',' ',' ','F','i','n','d',' ','c','l','o','s','e',' ','b','r','a','c','k','e','t',' ','_','\b','<','_','\b','c','_','\b','2','_','\b','>','.','\n', -' ',' ','E','S','C','-','^','B',' ','_','\b','<','_','\b','c','_','\b','1','_','\b','>',' ','_','\b','<','_','\b','c','_','\b','2','_','\b','>',' ',' ','*',' ',' ','F','i','n','d',' ','o','p','e','n',' ','b','r','a','c','k','e','t',' ','_','\b','<','_','\b','c','_','\b','1','_','\b','>',' ','\n', -' ',' ',' ',' ',' ',' ',' ',' ','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\n', -' ',' ',' ',' ',' ',' ',' ',' ','E','a','c','h',' ','"','f','i','n','d',' ','c','l','o','s','e',' ','b','r','a','c','k','e','t','"',' ','c','o','m','m','a','n','d',' ','g','o','e','s',' ','f','o','r','w','a','r','d',' ','t','o',' ','t','h','e',' ','c','l','o','s','e',' ','b','r','a','c','k','e','t',' ','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','m','a','t','c','h','i','n','g',' ','t','h','e',' ','(','_','\b','N','-','t','h',')',' ','o','p','e','n',' ','b','r','a','c','k','e','t',' ','i','n',' ','t','h','e',' ','t','o','p',' ','l','i','n','e','.','\n', -' ',' ',' ',' ',' ',' ',' ',' ','E','a','c','h',' ','"','f','i','n','d',' ','o','p','e','n',' ','b','r','a','c','k','e','t','"',' ','c','o','m','m','a','n','d',' ','g','o','e','s',' ','b','a','c','k','w','a','r','d',' ','t','o',' ','t','h','e',' ','o','p','e','n',' ','b','r','a','c','k','e','t',' ','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','m','a','t','c','h','i','n','g',' ','t','h','e',' ','(','_','\b','N','-','t','h',')',' ','c','l','o','s','e',' ','b','r','a','c','k','e','t',' ','i','n',' ','t','h','e',' ','b','o','t','t','o','m',' ','l','i','n','e','.','\n', -'\n', -' ',' ','m','_','\b','<','_','\b','l','_','\b','e','_','\b','t','_','\b','t','_','\b','e','_','\b','r','_','\b','>',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','M','a','r','k',' ','t','h','e',' ','c','u','r','r','e','n','t',' ','p','o','s','i','t','i','o','n',' ','w','i','t','h',' ','<','l','e','t','t','e','r','>','.','\n', -' ',' ','\'','_','\b','<','_','\b','l','_','\b','e','_','\b','t','_','\b','t','_','\b','e','_','\b','r','_','\b','>',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','G','o',' ','t','o',' ','a',' ','p','r','e','v','i','o','u','s','l','y',' ','m','a','r','k','e','d',' ','p','o','s','i','t','i','o','n','.','\n', -' ',' ','\'','\'',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','G','o',' ','t','o',' ','t','h','e',' ','p','r','e','v','i','o','u','s',' ','p','o','s','i','t','i','o','n','.','\n', -' ',' ','^','X','^','X',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','a','m','e',' ','a','s',' ','\'','.','\n', -' ',' ',' ',' ',' ',' ',' ',' ','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\n', -' ',' ',' ',' ',' ',' ',' ',' ','A',' ','m','a','r','k',' ','i','s',' ','a','n','y',' ','u','p','p','e','r','-','c','a','s','e',' ','o','r',' ','l','o','w','e','r','-','c','a','s','e',' ','l','e','t','t','e','r','.','\n', -' ',' ',' ',' ',' ',' ',' ',' ','C','e','r','t','a','i','n',' ','m','a','r','k','s',' ','a','r','e',' ','p','r','e','d','e','f','i','n','e','d',':','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','^',' ',' ','m','e','a','n','s',' ',' ','b','e','g','i','n','n','i','n','g',' ','o','f',' ','t','h','e',' ','f','i','l','e','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','$',' ',' ','m','e','a','n','s',' ',' ','e','n','d',' ','o','f',' ','t','h','e',' ','f','i','l','e','\n', -' ','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\n', -'\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','C','\b','C','H','\b','H','A','\b','A','N','\b','N','G','\b','G','I','\b','I','N','\b','N','G','\b','G',' ','F','\b','F','I','\b','I','L','\b','L','E','\b','E','S','\b','S','\n', -'\n', -' ',' ',':','e',' ','[','_','\b','f','_','\b','i','_','\b','l','_','\b','e',']',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','x','a','m','i','n','e',' ','a',' ','n','e','w',' ','f','i','l','e','.','\n', -' ',' ','^','X','^','V',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','a','m','e',' ','a','s',' ',':','e','.','\n', -' ',' ',':','n',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','E','x','a','m','i','n','e',' ','t','h','e',' ','(','_','\b','N','-','t','h',')',' ','n','e','x','t',' ','f','i','l','e',' ','f','r','o','m',' ','t','h','e',' ','c','o','m','m','a','n','d',' ','l','i','n','e','.','\n', -' ',' ',':','p',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','E','x','a','m','i','n','e',' ','t','h','e',' ','(','_','\b','N','-','t','h',')',' ','p','r','e','v','i','o','u','s',' ','f','i','l','e',' ','f','r','o','m',' ','t','h','e',' ','c','o','m','m','a','n','d',' ','l','i','n','e','.','\n', -' ',' ',':','x',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','E','x','a','m','i','n','e',' ','t','h','e',' ','f','i','r','s','t',' ','(','o','r',' ','_','\b','N','-','t','h',')',' ','f','i','l','e',' ','f','r','o','m',' ','t','h','e',' ','c','o','m','m','a','n','d',' ','l','i','n','e','.','\n', -' ',' ',':','d',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','e','l','e','t','e',' ','t','h','e',' ','c','u','r','r','e','n','t',' ','f','i','l','e',' ','f','r','o','m',' ','t','h','e',' ','c','o','m','m','a','n','d',' ','l','i','n','e',' ','l','i','s','t','.','\n', -' ',' ','=',' ',' ','^','G',' ',' ',':','f',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','P','r','i','n','t',' ','c','u','r','r','e','n','t',' ','f','i','l','e',' ','n','a','m','e','.','\n', -' ','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\n', -'\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','M','\b','M','I','\b','I','S','\b','S','C','\b','C','E','\b','E','L','\b','L','L','\b','L','A','\b','A','N','\b','N','E','\b','E','O','\b','O','U','\b','U','S','\b','S',' ','C','\b','C','O','\b','O','M','\b','M','M','\b','M','A','\b','A','N','\b','N','D','\b','D','S','\b','S','\n', -'\n', -' ',' ','-','_','\b','<','_','\b','f','_','\b','l','_','\b','a','_','\b','g','_','\b','>',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','T','o','g','g','l','e',' ','a',' ','c','o','m','m','a','n','d',' ','l','i','n','e',' ','o','p','t','i','o','n',' ','[','s','e','e',' ','O','P','T','I','O','N','S',' ','b','e','l','o','w',']','.','\n', -' ',' ','-','-','_','\b','<','_','\b','n','_','\b','a','_','\b','m','_','\b','e','_','\b','>',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','T','o','g','g','l','e',' ','a',' ','c','o','m','m','a','n','d',' ','l','i','n','e',' ','o','p','t','i','o','n',',',' ','b','y',' ','n','a','m','e','.','\n', -' ',' ','_','_','\b','<','_','\b','f','_','\b','l','_','\b','a','_','\b','g','_','\b','>',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','i','s','p','l','a','y',' ','t','h','e',' ','s','e','t','t','i','n','g',' ','o','f',' ','a',' ','c','o','m','m','a','n','d',' ','l','i','n','e',' ','o','p','t','i','o','n','.','\n', -' ',' ','_','_','_','\b','<','_','\b','n','_','\b','a','_','\b','m','_','\b','e','_','\b','>',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','i','s','p','l','a','y',' ','t','h','e',' ','s','e','t','t','i','n','g',' ','o','f',' ','a','n',' ','o','p','t','i','o','n',',',' ','b','y',' ','n','a','m','e','.','\n', -' ',' ','+','_','\b','c','_','\b','m','_','\b','d',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','x','e','c','u','t','e',' ','t','h','e',' ','l','e','s','s',' ','c','m','d',' ','e','a','c','h',' ','t','i','m','e',' ','a',' ','n','e','w',' ','f','i','l','e',' ','i','s',' ','e','x','a','m','i','n','e','d','.','\n', -'\n', -' ',' ','!','_','\b','c','_','\b','o','_','\b','m','_','\b','m','_','\b','a','_','\b','n','_','\b','d',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','x','e','c','u','t','e',' ','t','h','e',' ','s','h','e','l','l',' ','c','o','m','m','a','n','d',' ','w','i','t','h',' ','$','S','H','E','L','L','.','\n', -' ',' ','|','X','\b','X','_','\b','c','_','\b','o','_','\b','m','_','\b','m','_','\b','a','_','\b','n','_','\b','d',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','P','i','p','e',' ','f','i','l','e',' ','b','e','t','w','e','e','n',' ','c','u','r','r','e','n','t',' ','p','o','s',' ','&',' ','m','a','r','k',' ','X','\b','X',' ','t','o',' ','s','h','e','l','l',' ','c','o','m','m','a','n','d','.','\n', -' ',' ','v',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','d','i','t',' ','t','h','e',' ','c','u','r','r','e','n','t',' ','f','i','l','e',' ','w','i','t','h',' ','$','V','I','S','U','A','L',' ','o','r',' ','$','E','D','I','T','O','R','.','\n', -' ',' ','V',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','P','r','i','n','t',' ','v','e','r','s','i','o','n',' ','n','u','m','b','e','r',' ','o','f',' ','"','l','e','s','s','"','.','\n', -' ','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\n', -'\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','O','\b','O','P','\b','P','T','\b','T','I','\b','I','O','\b','O','N','\b','N','S','\b','S','\n', -'\n', -' ',' ',' ',' ',' ',' ',' ',' ','M','o','s','t',' ','o','p','t','i','o','n','s',' ','m','a','y',' ','b','e',' ','c','h','a','n','g','e','d',' ','e','i','t','h','e','r',' ','o','n',' ','t','h','e',' ','c','o','m','m','a','n','d',' ','l','i','n','e',',','\n', -' ',' ',' ',' ',' ',' ',' ',' ','o','r',' ','f','r','o','m',' ','w','i','t','h','i','n',' ','l','e','s','s',' ','b','y',' ','u','s','i','n','g',' ','t','h','e',' ','-',' ','o','r',' ','-','-',' ','c','o','m','m','a','n','d','.','\n', -' ',' ',' ',' ',' ',' ',' ',' ','O','p','t','i','o','n','s',' ','m','a','y',' ','b','e',' ','g','i','v','e','n',' ','i','n',' ','o','n','e',' ','o','f',' ','t','w','o',' ','f','o','r','m','s',':',' ','e','i','t','h','e','r',' ','a',' ','s','i','n','g','l','e','\n', -' ',' ',' ',' ',' ',' ',' ',' ','c','h','a','r','a','c','t','e','r',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','a',' ','-',',',' ','o','r',' ','a',' ','n','a','m','e',' ','p','r','e','c','e','e','d','e','d',' ','b','y',' ','-','-','.','\n', -'\n', -' ',' ','-','?',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','h','e','l','p','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','i','s','p','l','a','y',' ','h','e','l','p',' ','(','f','r','o','m',' ','c','o','m','m','a','n','d',' ','l','i','n','e',')','.','\n', -' ',' ','-','a',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','s','e','a','r','c','h','-','s','k','i','p','-','s','c','r','e','e','n','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','F','o','r','w','a','r','d',' ','s','e','a','r','c','h',' ','s','k','i','p','s',' ','c','u','r','r','e','n','t',' ','s','c','r','e','e','n','.','\n', -' ',' ','-','b',' ','[','_','\b','N',']',' ',' ','.','.','.','.',' ',' ','-','-','b','u','f','f','e','r','s','=','[','_','\b','N',']','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','N','u','m','b','e','r',' ','o','f',' ','b','u','f','f','e','r','s','.','\n', -' ',' ','-','B',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','a','u','t','o','-','b','u','f','f','e','r','s','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','o','n','\'','t',' ','a','u','t','o','m','a','t','i','c','a','l','l','y',' ','a','l','l','o','c','a','t','e',' ','b','u','f','f','e','r','s',' ','f','o','r',' ','p','i','p','e','s','.','\n', -' ',' ','-','c',' ',' ','-','C',' ',' ','.','.','.','.',' ',' ','-','-','c','l','e','a','r','-','s','c','r','e','e','n',' ',' ','-','-','C','L','E','A','R','-','S','C','R','E','E','N','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','R','e','p','a','i','n','t',' ','b','y',' ','s','c','r','o','l','l','i','n','g','/','c','l','e','a','r','i','n','g','.','\n', -' ',' ','-','d',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','d','u','m','b','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','u','m','b',' ','t','e','r','m','i','n','a','l','.','\n', -' ',' ','-','D',' ','[','_','\b','x','_','\b','n','_','\b','.','_','\b','n',']',' ',' ','.',' ',' ','-','-','c','o','l','o','r','=','_','\b','x','_','\b','n','_','\b','.','_','\b','n','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','e','t',' ','s','c','r','e','e','n',' ','c','o','l','o','r','s','.',' ','(','M','S','-','D','O','S',' ','o','n','l','y',')','\n', -' ',' ','-','e',' ',' ','-','E',' ',' ','.','.','.','.',' ',' ','-','-','q','u','i','t','-','a','t','-','e','o','f',' ',' ','-','-','Q','U','I','T','-','A','T','-','E','O','F','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','Q','u','i','t',' ','a','t',' ','e','n','d',' ','o','f',' ','f','i','l','e','.','\n', -' ',' ','-','f',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','f','o','r','c','e','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','F','o','r','c','e',' ','o','p','e','n',' ','n','o','n','-','r','e','g','u','l','a','r',' ','f','i','l','e','s','.','\n', -' ',' ','-','F',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','q','u','i','t','-','i','f','-','o','n','e','-','s','c','r','e','e','n','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','Q','u','i','t',' ','i','f',' ','e','n','t','i','r','e',' ','f','i','l','e',' ','f','i','t','s',' ','o','n',' ','f','i','r','s','t',' ','s','c','r','e','e','n','.','\n', -' ',' ','-','g',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','h','i','l','i','t','e','-','s','e','a','r','c','h','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','H','i','g','h','l','i','g','h','t',' ','o','n','l','y',' ','l','a','s','t',' ','m','a','t','c','h',' ','f','o','r',' ','s','e','a','r','c','h','e','s','.','\n', -' ',' ','-','G',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','H','I','L','I','T','E','-','S','E','A','R','C','H','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','o','n','\'','t',' ','h','i','g','h','l','i','g','h','t',' ','a','n','y',' ','m','a','t','c','h','e','s',' ','f','o','r',' ','s','e','a','r','c','h','e','s','.','\n', -' ',' ','-','h',' ','[','_','\b','N',']',' ',' ','.','.','.','.',' ',' ','-','-','m','a','x','-','b','a','c','k','-','s','c','r','o','l','l','=','[','_','\b','N',']','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','B','a','c','k','w','a','r','d',' ','s','c','r','o','l','l',' ','l','i','m','i','t','.','\n', -' ',' ','-','i',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','i','g','n','o','r','e','-','c','a','s','e','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','I','g','n','o','r','e',' ','c','a','s','e',' ','i','n',' ','s','e','a','r','c','h','e','s',' ','t','h','a','t',' ','d','o',' ','n','o','t',' ','c','o','n','t','a','i','n',' ','u','p','p','e','r','c','a','s','e','.','\n', -' ',' ','-','I',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','I','G','N','O','R','E','-','C','A','S','E','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','I','g','n','o','r','e',' ','c','a','s','e',' ','i','n',' ','a','l','l',' ','s','e','a','r','c','h','e','s','.','\n', -' ',' ','-','j',' ','[','_','\b','N',']',' ',' ','.','.','.','.',' ',' ','-','-','j','u','m','p','-','t','a','r','g','e','t','=','[','_','\b','N',']','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','c','r','e','e','n',' ','p','o','s','i','t','i','o','n',' ','o','f',' ','t','a','r','g','e','t',' ','l','i','n','e','s','.','\n', -' ',' ','-','J',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','s','t','a','t','u','s','-','c','o','l','u','m','n','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','i','s','p','l','a','y',' ','a',' ','s','t','a','t','u','s',' ','c','o','l','u','m','n',' ','a','t',' ','l','e','f','t',' ','e','d','g','e',' ','o','f',' ','s','c','r','e','e','n','.','\n', -' ',' ','-','k',' ','[','_','\b','f','_','\b','i','_','\b','l','_','\b','e',']',' ',' ','.',' ',' ','-','-','l','e','s','s','k','e','y','-','f','i','l','e','=','[','_','\b','f','_','\b','i','_','\b','l','_','\b','e',']','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','U','s','e',' ','a',' ','l','e','s','s','k','e','y',' ','f','i','l','e','.','\n', -' ',' ','-','L',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','n','o','-','l','e','s','s','o','p','e','n','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','I','g','n','o','r','e',' ','t','h','e',' ','L','E','S','S','O','P','E','N',' ','e','n','v','i','r','o','n','m','e','n','t',' ','v','a','r','i','a','b','l','e','.','\n', -' ',' ','-','m',' ',' ','-','M',' ',' ','.','.','.','.',' ',' ','-','-','l','o','n','g','-','p','r','o','m','p','t',' ',' ','-','-','L','O','N','G','-','P','R','O','M','P','T','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','e','t',' ','p','r','o','m','p','t',' ','s','t','y','l','e','.','\n', -' ',' ','-','n',' ',' ','-','N',' ',' ','.','.','.','.',' ',' ','-','-','l','i','n','e','-','n','u','m','b','e','r','s',' ',' ','-','-','L','I','N','E','-','N','U','M','B','E','R','S','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','U','s','e',' ','l','i','n','e',' ','n','u','m','b','e','r','s','.','\n', -' ',' ','-','o',' ','[','_','\b','f','_','\b','i','_','\b','l','_','\b','e',']',' ',' ','.',' ',' ','-','-','l','o','g','-','f','i','l','e','=','[','_','\b','f','_','\b','i','_','\b','l','_','\b','e',']','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','C','o','p','y',' ','t','o',' ','l','o','g',' ','f','i','l','e',' ','(','s','t','a','n','d','a','r','d',' ','i','n','p','u','t',' ','o','n','l','y',')','.','\n', -' ',' ','-','O',' ','[','_','\b','f','_','\b','i','_','\b','l','_','\b','e',']',' ',' ','.',' ',' ','-','-','L','O','G','-','F','I','L','E','=','[','_','\b','f','_','\b','i','_','\b','l','_','\b','e',']','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','C','o','p','y',' ','t','o',' ','l','o','g',' ','f','i','l','e',' ','(','u','n','c','o','n','d','i','t','i','o','n','a','l','l','y',' ','o','v','e','r','w','r','i','t','e',')','.','\n', -' ',' ','-','p',' ','[','_','\b','p','_','\b','a','_','\b','t','_','\b','t','_','\b','e','_','\b','r','_','\b','n',']',' ',' ','-','-','p','a','t','t','e','r','n','=','[','_','\b','p','_','\b','a','_','\b','t','_','\b','t','_','\b','e','_','\b','r','_','\b','n',']','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','t','a','r','t',' ','a','t',' ','p','a','t','t','e','r','n',' ','(','f','r','o','m',' ','c','o','m','m','a','n','d',' ','l','i','n','e',')','.','\n', -' ',' ','-','P',' ','[','_','\b','p','_','\b','r','_','\b','o','_','\b','m','_','\b','p','_','\b','t',']',' ',' ',' ','-','-','p','r','o','m','p','t','=','[','_','\b','p','_','\b','r','_','\b','o','_','\b','m','_','\b','p','_','\b','t',']','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','e','f','i','n','e',' ','n','e','w',' ','p','r','o','m','p','t','.','\n', -' ',' ','-','q',' ',' ','-','Q',' ',' ','.','.','.','.',' ',' ','-','-','q','u','i','e','t',' ',' ','-','-','Q','U','I','E','T',' ',' ','-','-','s','i','l','e','n','t',' ','-','-','S','I','L','E','N','T','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','Q','u','i','e','t',' ','t','h','e',' ','t','e','r','m','i','n','a','l',' ','b','e','l','l','.','\n', -' ',' ','-','r',' ',' ','-','R',' ',' ','.','.','.','.',' ',' ','-','-','r','a','w','-','c','o','n','t','r','o','l','-','c','h','a','r','s',' ',' ','-','-','R','A','W','-','C','O','N','T','R','O','L','-','C','H','A','R','S','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','O','u','t','p','u','t',' ','"','r','a','w','"',' ','c','o','n','t','r','o','l',' ','c','h','a','r','a','c','t','e','r','s','.','\n', -' ',' ','-','s',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','s','q','u','e','e','z','e','-','b','l','a','n','k','-','l','i','n','e','s','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','q','u','e','e','z','e',' ','m','u','l','t','i','p','l','e',' ','b','l','a','n','k',' ','l','i','n','e','s','.','\n', -' ',' ','-','S',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','c','h','o','p','-','l','o','n','g','-','l','i','n','e','s','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','C','h','o','p',' ','l','o','n','g',' ','l','i','n','e','s','.','\n', -' ',' ','-','t',' ','[','_','\b','t','_','\b','a','_','\b','g',']',' ',' ','.','.',' ',' ','-','-','t','a','g','=','[','_','\b','t','_','\b','a','_','\b','g',']','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','F','i','n','d',' ','a',' ','t','a','g','.','\n', -' ',' ','-','T',' ','[','_','\b','t','_','\b','a','_','\b','g','_','\b','s','_','\b','f','_','\b','i','_','\b','l','_','\b','e',']',' ','-','-','t','a','g','-','f','i','l','e','=','[','_','\b','t','_','\b','a','_','\b','g','_','\b','s','_','\b','f','_','\b','i','_','\b','l','_','\b','e',']','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','U','s','e',' ','a','n',' ','a','l','t','e','r','n','a','t','e',' ','t','a','g','s',' ','f','i','l','e','.','\n', -' ',' ','-','u',' ',' ','-','U',' ',' ','.','.','.','.',' ',' ','-','-','u','n','d','e','r','l','i','n','e','-','s','p','e','c','i','a','l',' ',' ','-','-','U','N','D','E','R','L','I','N','E','-','S','P','E','C','I','A','L','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','C','h','a','n','g','e',' ','h','a','n','d','l','i','n','g',' ','o','f',' ','b','a','c','k','s','p','a','c','e','s','.','\n', -' ',' ','-','V',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','v','e','r','s','i','o','n','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','i','s','p','l','a','y',' ','t','h','e',' ','v','e','r','s','i','o','n',' ','n','u','m','b','e','r',' ','o','f',' ','"','l','e','s','s','"','.','\n', -' ',' ','-','w',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','h','i','l','i','t','e','-','u','n','r','e','a','d','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','H','i','g','h','l','i','g','h','t',' ','f','i','r','s','t',' ','n','e','w',' ','l','i','n','e',' ','a','f','t','e','r',' ','f','o','r','w','a','r','d','-','s','c','r','e','e','n','.','\n', -' ',' ','-','W',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','H','I','L','I','T','E','-','U','N','R','E','A','D','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','H','i','g','h','l','i','g','h','t',' ','f','i','r','s','t',' ','n','e','w',' ','l','i','n','e',' ','a','f','t','e','r',' ','a','n','y',' ','f','o','r','w','a','r','d',' ','m','o','v','e','m','e','n','t','.','\n', -' ',' ','-','x',' ','[','_','\b','N','[',',','.','.','.',']',']',' ',' ','-','-','t','a','b','s','=','[','_','\b','N','[',',','.','.','.',']',']','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','e','t',' ','t','a','b',' ','s','t','o','p','s','.','\n', -' ',' ','-','X',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','n','o','-','i','n','i','t','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','o','n','\'','t',' ','u','s','e',' ','t','e','r','m','c','a','p',' ','i','n','i','t','/','d','e','i','n','i','t',' ','s','t','r','i','n','g','s','.','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','n','o','-','k','e','y','p','a','d','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','o','n','\'','t',' ','u','s','e',' ','t','e','r','m','c','a','p',' ','k','e','y','p','a','d',' ','i','n','i','t','/','d','e','i','n','i','t',' ','s','t','r','i','n','g','s','.','\n', -' ',' ','-','y',' ','[','_','\b','N',']',' ',' ','.','.','.','.',' ',' ','-','-','m','a','x','-','f','o','r','w','-','s','c','r','o','l','l','=','[','_','\b','N',']','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','F','o','r','w','a','r','d',' ','s','c','r','o','l','l',' ','l','i','m','i','t','.','\n', -' ',' ','-','z',' ','[','_','\b','N',']',' ',' ','.','.','.','.',' ',' ','-','-','w','i','n','d','o','w','=','[','_','\b','N',']','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','e','t',' ','s','i','z','e',' ','o','f',' ','w','i','n','d','o','w','.','\n', -' ',' ','-','"',' ','[','_','\b','c','[','_','\b','c',']',']',' ',' ','.',' ',' ','-','-','q','u','o','t','e','s','=','[','_','\b','c','[','_','\b','c',']',']','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','e','t',' ','s','h','e','l','l',' ','q','u','o','t','e',' ','c','h','a','r','a','c','t','e','r','s','.','\n', -' ',' ','-','~',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','t','i','l','d','e','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','o','n','\'','t',' ','d','i','s','p','l','a','y',' ','t','i','l','d','e','s',' ','a','f','t','e','r',' ','e','n','d',' ','o','f',' ','f','i','l','e','.','\n', -' ',' ','-','#',' ','[','_','\b','N',']',' ',' ','.','.','.','.',' ',' ','-','-','s','h','i','f','t','=','[','_','\b','N',']','\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','H','o','r','i','z','o','n','t','a','l',' ','s','c','r','o','l','l',' ','a','m','o','u','n','t',' ','(','0',' ','=',' ','o','n','e',' ','h','a','l','f',' ','s','c','r','e','e','n',' ','w','i','d','t','h',')','\n', -'\n', -' ','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\n', -'\n', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','L','\b','L','I','\b','I','N','\b','N','E','\b','E',' ','E','\b','E','D','\b','D','I','\b','I','T','\b','T','I','\b','I','N','\b','N','G','\b','G','\n', -'\n', -' ',' ',' ',' ',' ',' ',' ',' ','T','h','e','s','e',' ','k','e','y','s',' ','c','a','n',' ','b','e',' ','u','s','e','d',' ','t','o',' ','e','d','i','t',' ','t','e','x','t',' ','b','e','i','n','g',' ','e','n','t','e','r','e','d',' ','\n', -' ',' ',' ',' ',' ',' ',' ',' ','o','n',' ','t','h','e',' ','"','c','o','m','m','a','n','d',' ','l','i','n','e','"',' ','a','t',' ','t','h','e',' ','b','o','t','t','o','m',' ','o','f',' ','t','h','e',' ','s','c','r','e','e','n','.','\n', -'\n', -' ','R','i','g','h','t','A','r','r','o','w',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','S','C','-','l',' ',' ',' ',' ',' ','M','o','v','e',' ','c','u','r','s','o','r',' ','r','i','g','h','t',' ','o','n','e',' ','c','h','a','r','a','c','t','e','r','.','\n', -' ','L','e','f','t','A','r','r','o','w',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','S','C','-','h',' ',' ',' ',' ',' ','M','o','v','e',' ','c','u','r','s','o','r',' ','l','e','f','t',' ','o','n','e',' ','c','h','a','r','a','c','t','e','r','.','\n', -' ','C','N','T','L','-','R','i','g','h','t','A','r','r','o','w',' ',' ','E','S','C','-','R','i','g','h','t','A','r','r','o','w',' ',' ','E','S','C','-','w',' ',' ',' ',' ',' ','M','o','v','e',' ','c','u','r','s','o','r',' ','r','i','g','h','t',' ','o','n','e',' ','w','o','r','d','.','\n', -' ','C','N','T','L','-','L','e','f','t','A','r','r','o','w',' ',' ',' ','E','S','C','-','L','e','f','t','A','r','r','o','w',' ',' ',' ','E','S','C','-','b',' ',' ',' ',' ',' ','M','o','v','e',' ','c','u','r','s','o','r',' ','l','e','f','t',' ','o','n','e',' ','w','o','r','d','.','\n', -' ','H','O','M','E',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','S','C','-','0',' ',' ',' ',' ',' ','M','o','v','e',' ','c','u','r','s','o','r',' ','t','o',' ','s','t','a','r','t',' ','o','f',' ','l','i','n','e','.','\n', -' ','E','N','D',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','S','C','-','$',' ',' ',' ',' ',' ','M','o','v','e',' ','c','u','r','s','o','r',' ','t','o',' ','e','n','d',' ','o','f',' ','l','i','n','e','.','\n', -' ','B','A','C','K','S','P','A','C','E',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','e','l','e','t','e',' ','c','h','a','r',' ','t','o',' ','l','e','f','t',' ','o','f',' ','c','u','r','s','o','r','.','\n', -' ','D','E','L','E','T','E',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','S','C','-','x',' ',' ',' ',' ',' ','D','e','l','e','t','e',' ','c','h','a','r',' ','u','n','d','e','r',' ','c','u','r','s','o','r','.','\n', -' ','C','N','T','L','-','B','A','C','K','S','P','A','C','E',' ',' ',' ','E','S','C','-','B','A','C','K','S','P','A','C','E',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','e','l','e','t','e',' ','w','o','r','d',' ','t','o',' ','l','e','f','t',' ','o','f',' ','c','u','r','s','o','r','.','\n', -' ','C','N','T','L','-','D','E','L','E','T','E',' ',' ',' ',' ',' ',' ','E','S','C','-','D','E','L','E','T','E',' ',' ',' ',' ',' ',' ','E','S','C','-','X',' ',' ',' ',' ',' ','D','e','l','e','t','e',' ','w','o','r','d',' ','u','n','d','e','r',' ','c','u','r','s','o','r','.','\n', -' ','C','N','T','L','-','U',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','S','C',' ','(','M','S','-','D','O','S',' ','o','n','l','y',')',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','e','l','e','t','e',' ','e','n','t','i','r','e',' ','l','i','n','e','.','\n', -' ','U','p','A','r','r','o','w',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','S','C','-','k',' ',' ',' ',' ',' ','R','e','t','r','i','e','v','e',' ','p','r','e','v','i','o','u','s',' ','c','o','m','m','a','n','d',' ','l','i','n','e','.','\n', -' ','D','o','w','n','A','r','r','o','w',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','S','C','-','j',' ',' ',' ',' ',' ','R','e','t','r','i','e','v','e',' ','n','e','x','t',' ','c','o','m','m','a','n','d',' ','l','i','n','e','.','\n', -' ','T','A','B',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','C','o','m','p','l','e','t','e',' ','f','i','l','e','n','a','m','e',' ','&',' ','c','y','c','l','e','.','\n', -' ','S','H','I','F','T','-','T','A','B',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','S','C','-','T','A','B',' ',' ',' ','C','o','m','p','l','e','t','e',' ','f','i','l','e','n','a','m','e',' ','&',' ','r','e','v','e','r','s','e',' ','c','y','c','l','e','.','\n', -' ','C','N','T','L','-','L',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','C','o','m','p','l','e','t','e',' ','f','i','l','e','n','a','m','e',',',' ','l','i','s','t',' ','a','l','l','.','\n', -'\n', - 0 }; -constant int size_helpdata = sizeof(helpdata) - 1; +/* $OpenBSD: help.c,v 1.5 2003/04/14 14:33:57 millert Exp $ */ + +/* + * Copyright (c) 1984,1985,1989,1994,1995 Mark Nudelman + * 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 in the documentation and/or other materials provided with + * the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + */ + + +/* + * Display some help. + * Just invoke another "less" to display the help file. + * + * {{ This makes this function very simple, and makes changing the + * help file very easy, but it may present difficulties on + * (non-Unix) systems which do not supply the "system()" function. }} + */ + +#include "less.h" + +extern char *progname; + + public void +help(nomsg) + int nomsg; +{ +#ifdef HELPFILE + char *helpfile; + char *cmd; + size_t len; + + helpfile = find_helpfile(); + if (helpfile == NULL) + { + error("Cannot find help file", NULL_PARG); + return; + } +#if !HAVE_SYSTEM + /* + * Just examine the help file. + */ + (void) edit(helpfile); +#else + /* + * Use lsystem() to invoke a new instance of less + * to view the help file. + */ +#if MSDOS_COMPILER + putenv("LESS=-m -H -+E -+s -PmHELP -- ?eEND -- Press g to see it again:Press RETURN for more., or q when done"); + len = strlen(helpfile) + strlen(progname) + 3; + cmd = (char *) ecalloc(len, sizeof(char)); + snprintf(cmd, len, "-%s %s", progname, helpfile); +#else + len = strlen(helpfile) + strlen(progname) + 150; + cmd = (char *) ecalloc(len, sizeof(char)); +#if OS2 + snprintf(cmd, len, + "-%s -m -H -+E -+s \"-PmHELP -- ?eEND -- Press g to see it again:Press RETURN for more., or q when done \" %s", + progname, helpfile); +#else + snprintf(cmd, len, + "-%s -m -H -+E -+s '-PmHELP -- ?eEND -- Press g to see it again:Press RETURN for more., or q when done ' %s", + progname, helpfile); +#endif +#endif + free(helpfile); + lsystem(cmd, (char*)NULL); + if (!nomsg) + error("End of help", NULL_PARG); + free(cmd); +#endif +#else + error("Cannot find help file", NULL_PARG); +#endif +} diff --git a/usr.bin/less/less.h b/usr.bin/less/less.h index 059a6dab55b..07911d5ce7d 100644 --- a/usr.bin/less/less.h +++ b/usr.bin/less/less.h @@ -404,12 +404,9 @@ struct textlist #define CH_CANSEEK 001 #define CH_KEEPOPEN 002 #define CH_POPENED 004 -#define CH_HELPFILE 010 #define ch_zero() ((POSITION)0) -#define FAKE_HELPFILE "@/\\less/\\help/\\file/\\@" - #include "funcs.h" /* Functions not included in funcs.h */ diff --git a/usr.bin/less/main.c b/usr.bin/less/main.c index 644f07253df..af90ced8aaa 100644 --- a/usr.bin/less/main.c +++ b/usr.bin/less/main.c @@ -31,7 +31,6 @@ public int wscroll; public char * progname; public int quitting; public int secure; -public int dohelp; public int ismore; #if LOGFILE @@ -167,8 +166,6 @@ main(argc, argv) * to "register" them with the ifile system. */ ifile = NULL_IFILE; - if (dohelp) - ifile = get_ifile(FAKE_HELPFILE, ifile); while (argc-- > 0) { char *filename; diff --git a/usr.bin/less/mark.c b/usr.bin/less/mark.c index 04f97885d10..bf6350735d1 100644 --- a/usr.bin/less/mark.c +++ b/usr.bin/less/mark.c @@ -165,8 +165,6 @@ lastmark() { struct scrpos scrpos; - if (ch_getflags() & CH_HELPFILE) - return; get_scrpos(&scrpos); if (scrpos.pos == NULL_POSITION) return; diff --git a/usr.bin/less/mkhelp.c b/usr.bin/less/mkhelp.c deleted file mode 100644 index d05cb49945c..00000000000 --- a/usr.bin/less/mkhelp.c +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 1984-2002 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information about less, or for information on how to - * contact the author, see the README file. - */ - - -/* - * Silly little program to generate the help.c source file - * from the less.hlp text file. - * help.c just contains a char array whose contents are - * the contents of less.hlp. - */ - -#include <stdio.h> - - int -main(argc, argv) - int argc; - char *argv[]; -{ - int ch; - int prevch; - - printf("/* This file was generated by mkhelp from less.hlp */\n"); - printf("#include \"less.h\"\n"); - printf("constant char helpdata[] = {\n"); - ch = 0; - while (prevch = ch, (ch = getchar()) != EOF) - { - switch (ch) - { - case '\'': - printf("'\\'',"); - break; - case '\\': - printf("'\\\\',"); - break; - case '\b': - printf("'\\b',"); - break; - case '\t': - printf("'\\t',"); - break; - case '\n': - if (prevch != '\r') - printf("'\\n',\n"); - break; - case '\r': - if (prevch != '\n') - printf("'\\n',\n"); - break; - default: - if (ch >= ' ' && ch < 0x7f) - printf("'%c',", ch); - else - printf("0x%02x,", ch); - break; - } - } - /* Add an extra null char to avoid having a trailing comma. */ - printf(" 0 };\n"); - printf("constant int size_helpdata = sizeof(helpdata) - 1;\n"); - return (0); -} diff --git a/usr.bin/less/optfunc.c b/usr.bin/less/optfunc.c index 077168886d3..8f6e89c787c 100644 --- a/usr.bin/less/optfunc.c +++ b/usr.bin/less/optfunc.c @@ -31,11 +31,11 @@ extern int nbufs; extern int bufspace; extern int pr_type; +extern int nohelp; extern int plusoption; extern int swindow; extern int sc_height; extern int secure; -extern int dohelp; extern int any_display; extern char openquote; extern char closequote; @@ -572,6 +572,8 @@ opt_query(type, s) int type; char *s; { + if (nohelp) + return; switch (type) { case QUERY: @@ -579,7 +581,20 @@ opt_query(type, s) error("Use \"h\" for help", NULL_PARG); break; case INIT: - dohelp = 1; + /* + * This is "less -?". + * It rather ungracefully grabs control, + * does the initializations normally done in main, + * shows the help file and exits. + */ + raw_mode(1); + get_term(); + open_getchr(); + init(); + any_display = TRUE; + help(1); + quit(QUIT_OK); + /*NOTREACHED*/ } } diff --git a/usr.bin/less/opttbl.c b/usr.bin/less/opttbl.c index d1c23c3eecf..f3f45c8b014 100644 --- a/usr.bin/less/opttbl.c +++ b/usr.bin/less/opttbl.c @@ -36,6 +36,7 @@ public int forw_scroll; /* Repaint screen on forward movement */ public int caseless; /* Do "caseless" searches */ public int linenums; /* Use line numbers */ public int autobuf; /* Automatically allocate buffers as needed */ +public int nohelp; /* Disable the HELP command */ public int bufspace; /* Max buffer space per file (K) */ public int ctldisp; /* Send control chars to screen untranslated */ public int force_open; /* Open the file even if not regular file */ @@ -216,6 +217,14 @@ static struct loption option[] = NULL } }, + { 'H', NULL, + BOOL|NO_TOGGLE, OPT_OFF, &nohelp, NULL, + { + "Allow help command", + "Don't allow help command", + NULL + } + }, { 'i', &i_optname, TRIPLE|HL_REPAINT, OPT_OFF, &caseless, opt_i, { diff --git a/usr.bin/less/prompt.c b/usr.bin/less/prompt.c index 9a257809fab..157012d4382 100644 --- a/usr.bin/less/prompt.c +++ b/usr.bin/less/prompt.c @@ -553,9 +553,7 @@ pr_string() { char *prompt; - prompt = pr_expand((ch_getflags() & CH_HELPFILE) ? - hproto : prproto[pr_type], - sc_width-so_s_width-so_e_width-2); + prompt = pr_expand(prproto[pr_type], sc_width-so_s_width-so_e_width-2); new_file = 0; return (prompt); } |