diff -U2 less-278/Makefile.in less-290/Makefile.in --- less-278/Makefile.in Tue Jan 31 18:55:17 1995 +++ less-290/Makefile.in Mon Mar 13 16:41:54 1995 @@ -22,11 +22,11 @@ # Where the installed binary goes. -bindir = $(exec_prefix)/bin +bindir = ${exec_prefix}/bin binprefix = # Where the help file goes. -datadir = $(prefix)/share +datadir = ${prefix}/share -mandir = $(prefix)/man/man$(manext) +mandir = ${prefix}/man/man${manext} manext = 1 manprefix = @@ -39,5 +39,5 @@ # in addition to whatever the user asks for. .c.o: - $(CC) -I. $(CFLAGS_COMPILE_ONLY) $(CPPFLAGS) $(CFLAGS) $< + ${CC} -I. ${CFLAGS_COMPILE_ONLY} ${CPPFLAGS} ${CFLAGS} $< SRC = main.c screen.c brac.c ch.c charset.c cmdbuf.c \ @@ -47,10 +47,10 @@ output.c position.c prompt.c search.c signal.c \ tags.c ttyin.c version.c -OBJ = main.$(O) screen.$(O) brac.$(O) ch.$(O) charset.$(O) cmdbuf.$(O) \ - command.$(O) decode.$(O) edit.$(O) filename.$(O) forwback.$(O) \ - help.$(O) ifile.$(O) input.$(O) jump.$(O) line.$(O) linenum.$(O) \ - lsystem.$(O) mark.$(O) optfunc.$(O) option.$(O) opttbl.$(O) os.$(O) \ - output.$(O) position.$(O) prompt.$(O) search.$(O) signal.$(O) \ - tags.$(O) ttyin.$(O) version.$(O) @REGEX_O@ +OBJ = main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \ + command.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \ + help.${O} ifile.${O} input.${O} jump.${O} line.${O} linenum.${O} \ + lsystem.${O} mark.${O} optfunc.${O} option.${O} opttbl.${O} os.${O} \ + output.${O} position.${O} prompt.${O} search.${O} signal.${O} \ + tags.${O} ttyin.${O} version.${O} @REGEX_O@ DISTFILES = ${SRC} regexp.c regexp.h \ INSTALL Makefile.in README NEWS \ @@ -64,13 +64,13 @@ all: less lesskey -less: $(OBJ) - $(CC) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) +less: ${OBJ} + ${CC} ${LDFLAGS} -o $@ ${OBJ} ${LIBS} -lesskey: lesskey.$(O) version.$(O) - $(CC) $(LDFLAGS) -o $@ lesskey.$(O) version.$(O) +lesskey: lesskey.${O} version.${O} + ${CC} ${LDFLAGS} -o $@ lesskey.${O} version.${O} -$(OBJ): less.h defines.h funcs.h +${OBJ}: less.h defines.h funcs.h -filename.$(O): filename.c +filename.${O}: filename.c ${CC} -c -DHELPFILE=\"${datadir}/less.hlp\" -I. ${CPPFLAGS} ${CFLAGS} ${srcdir}/filename.c @@ -107,14 +107,18 @@ Makefile: Makefile.in config.status CONFIG_FILES=Makefile CONFIG_HEADERS= ./config.status -config.status: configure +config.status: ${srcdir}/configure ./config.status --recheck +configure: configure.in + autoheader + autoconf + lint: - lint -I. $(CPPFLAGS) $(SRC) + lint -I. ${CPPFLAGS} ${SRC} newfuncs: mv -f funcs.h funcs.h.old - awk -f mkfuncs.awk $(SRC) >funcs.h + awk -f mkfuncs.awk ${SRC} >funcs.h clean: - rm -f *.$(O) core less lesskey + rm -f *.${O} core less lesskey mostlyclean: clean @@ -138,2 +142,7 @@ tar -chf - $$REL | gzip -c >release/$$REL/$$REL.tar.gz; \ rm -rf $$REL + +tagall: + @REL=`sed -e '/char version/!d' -e 's/[^0-9.]*\([0-9.]*\).*/v\1/' -e q version.c`; \ + echo "tagging $$REL"; \ + $(RCS) -N$$REL: RCS/*,v diff -U2 less-278/Makefile.os2 less-290/Makefile.os2 --- less-278/Makefile.os2 Tue Jan 31 18:55:23 1995 +++ less-290/Makefile.os2 Mon Mar 6 23:32:26 1995 @@ -4,6 +4,6 @@ #### Start of system configuration section. #### -CC = gcc -CFLAGS = -I. -Zomf -O +CC = gcc -Zomf +CFLAGS = -I. -O LDFLAGS = -s -Zcrtdll -Zstack 512 LIBS = -ltermcap @@ -17,5 +17,5 @@ # in addition to whatever the user asks for. .c.$(O): - ${CC} -c -I. ${CPPFLAGS} ${CFLAGS} $< + ${CC} -c ${CPPFLAGS} ${CFLAGS} $< OBJ = main.$(O) screen.$(O) brac.$(O) ch.$(O) charset.$(O) cmdbuf.$(O) \ diff -U2 less-278/NEWS less-290/NEWS --- less-278/NEWS Wed Feb 15 01:13:44 1995 +++ less-290/NEWS Fri Mar 10 20:46:58 1995 @@ -1,2 +1,13 @@ + Major changes between "less" versions 278 and 290 + +* Accepts GNU-style options "--help" and "--version". + +* OS/2 version looks for less.ini in $HOME before $INIT and $PATH. + +* Bug fixes + +====================================================================== + + Major changes between "less" versions 252 and 278 diff -U2 less-278/README less-290/README --- less-278/README Tue Feb 14 13:23:21 1995 +++ less-290/README Fri Mar 10 20:39:27 1995 @@ -1,4 +1,4 @@ ======================================================================= -=== NOTE: THIS IS A DISTRIBUTION OF less (version 278) === +=== NOTE: THIS IS A DISTRIBUTION OF less (version 290) === === PLEASE REPORT ANY PROBLEMS TO THE AUTHOR AT markn@3do.com. === ======================================================================= diff -U2 less-278/command.c less-290/command.c --- less-278/command.c Tue Jan 31 18:55:32 1995 +++ less-290/command.c Thu Mar 2 18:21:42 1995 @@ -49,4 +49,5 @@ extern int ignore_eoi; extern char *every_first_cmd; +extern char *curr_altfilename; extern char version[]; extern struct scrpos initial_scrpos; @@ -209,6 +210,4 @@ free(shellcmd); shellcmd = fexpand(cbuf); - if (shellcmd == NULL) - break; } @@ -1077,4 +1076,10 @@ { error("Cannot edit standard input", NULL_PARG); + break; + } + if (curr_altfilename != NULL) + { + error("Cannot edit file processed with LESSOPEN", + NULL_PARG); break; } diff -U2 less-278/configure less-290/configure --- less-278/configure Wed Feb 15 01:16:39 1995 +++ less-290/configure Mon Mar 13 16:42:19 1995 @@ -840,4 +840,43 @@ fi +echo $ac_n "checking for -lPW""... $ac_c" 1>&4 +if eval "test \"`echo '${'ac_cv_lib_PW'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&4 +else + ac_save_LIBS="$LIBS" +LIBS="$LIBS -lPW " +cat > conftest.$ac_ext <&4 + ac_tr_lib=HAVE_LIB`echo PW | tr '[a-z]' '[A-Z]'` + cat >> confdefs.h <&4 +fi + echo $ac_n "checking for working terminal libraries""... $ac_c" 1>&4 @@ -845,5 +884,5 @@ LIBS="$LIBS $TERMLIBS" cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < @@ -927,5 +966,5 @@ # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < @@ -945,5 +984,5 @@ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < @@ -966,5 +1005,5 @@ else cat > conftest.$ac_ext < @@ -1003,5 +1042,5 @@ else cat > conftest.$ac_ext < @@ -1037,5 +1076,5 @@ else cat > conftest.$ac_ext < @@ -1065,5 +1104,5 @@ echo $ac_n "checking for void""... $ac_c" 1>&4 cat > conftest.$ac_ext <&4 cat > conftest.$ac_ext < @@ -1113,5 +1152,5 @@ else cat > conftest.$ac_ext < @@ -1149,5 +1188,5 @@ else cat > conftest.$ac_ext < /* Arbitrary system header to define __stub macros. */ @@ -1196,5 +1235,5 @@ else cat > conftest.$ac_ext < /* Arbitrary system header to define __stub macros. */ @@ -1238,5 +1277,5 @@ echo $ac_n "checking for fileno""... $ac_c" 1>&4 cat > conftest.$ac_ext <&4 cat > conftest.$ac_ext <&4 cat > conftest.$ac_ext <&4 cat > conftest.$ac_ext <&4 cat > conftest.$ac_ext < @@ -1361,5 +1400,5 @@ echo $ac_n "checking for ctype functions""... $ac_c" 1>&4 cat > conftest.$ac_ext <&4 cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < /* Arbitrary system header to define __stub macros. */ @@ -1543,5 +1582,5 @@ if test $have_regex = no; then cat > conftest.$ac_ext < conftest.$ac_ext < /* Arbitrary system header to define __stub macros. */ diff -U2 less-278/configure.in less-290/configure.in --- less-278/configure.in Tue Jan 31 18:55:33 1995 +++ less-290/configure.in Fri Mar 10 01:22:44 1995 @@ -18,4 +18,5 @@ AC_CHECK_LIB(gen, regcmp) AC_CHECK_LIB(intl, regcmp) +AC_CHECK_LIB(PW, regcmp) dnl Solaris has curses & termcap, but they don't work without libucb diff -U2 less-278/decode.c less-290/decode.c --- less-278/decode.c Tue Jan 31 18:55:34 1995 +++ less-290/decode.c Wed Mar 8 17:04:14 1995 @@ -209,4 +209,5 @@ add_fcmd_table((char*)cmdtable, sizeof(cmdtable)); add_ecmd_table((char*)edittable, sizeof(edittable)); + get_editkeys(); #if USERFILE /* diff -U2 less-278/defines.dos less-290/defines.dos --- less-278/defines.dos Tue Jan 31 18:55:35 1995 +++ less-290/defines.dos Fri Feb 24 15:25:42 1995 @@ -108,4 +108,10 @@ /* + * GNU_OPTIONS is 1 if you wish to support the GNU-style command + * line options --help and --version. + */ +#define GNU_OPTIONS 1 + +/* * ONLY_RETURN is 1 if you want RETURN to be the only input which * will continue past an error message. diff -U2 less-278/defines.h.in less-290/defines.h.in --- less-278/defines.h.in Tue Jan 3 20:00:30 1995 +++ less-290/defines.h.in Fri Feb 24 16:12:17 1995 @@ -87,4 +87,10 @@ /* + * GNU_OPTIONS is 1 if you wish to support the GNU-style command + * line options --help and --version. + */ +#define GNU_OPTIONS 1 + +/* * ONLY_RETURN is 1 if you want RETURN to be the only input which * will continue past an error message. @@ -251,4 +257,7 @@ /* Define if you have the header file. */ #undef HAVE_VALUES_H + +/* Define if you have the PW library (-lPW). */ +#undef HAVE_LIBPW /* Define if you have the gen library (-lgen). */ diff -U2 less-278/defines.h.top less-290/defines.h.top --- less-278/defines.h.top Tue Jan 31 18:55:36 1995 +++ less-290/defines.h.top Fri Feb 24 15:24:25 1995 @@ -86,4 +86,10 @@ /* + * GNU_OPTIONS is 1 if you wish to support the GNU-style command + * line options --help and --version. + */ +#define GNU_OPTIONS 1 + +/* * ONLY_RETURN is 1 if you want RETURN to be the only input which * will continue past an error message. diff -U2 less-278/defines.os2 less-290/defines.os2 --- less-278/defines.os2 Mon Jan 30 17:14:08 1995 +++ less-290/defines.os2 Fri Feb 24 15:25:50 1995 @@ -108,4 +108,10 @@ /* + * GNU_OPTIONS is 1 if you wish to support the GNU-style command + * line options --help and --version. + */ +#define GNU_OPTIONS 1 + +/* * ONLY_RETURN is 1 if you want RETURN to be the only input which * will continue past an error message. diff -U2 less-278/edit.c less-290/edit.c --- less-278/edit.c Tue Jan 31 18:55:38 1995 +++ less-290/edit.c Mon Mar 6 23:57:27 1995 @@ -48,5 +48,5 @@ #endif -static char *curr_altfilename = NULL; +char *curr_altfilename = NULL; static void *curr_altpipe; @@ -193,4 +193,5 @@ char *alt_filename; void *alt_pipe; + IFILE was_curr_ifile; PARG parg; @@ -213,15 +214,20 @@ end_logfile(); #endif + was_curr_ifile = curr_ifile; if (curr_ifile != NULL_IFILE) { - old_ifile = curr_ifile; close_file(); } if (ifile == NULL_IFILE) + { /* * No new file to open. + * (Don't set old_ifile, because if you call edit_ifile(NULL), + * you're supposed to have saved curr_ifile yourself, + * and you'll restore it if necessary.) */ return (0); + } filename = get_filename(ifile); @@ -269,5 +275,5 @@ * Re-open the current file. */ - (void) edit_ifile(old_ifile); + (void) edit_ifile(was_curr_ifile); return (1); } else if ((f = open(open_filename, OPEN_READ)) < 0) @@ -299,4 +305,6 @@ * Get the saved position for the file. */ + if (was_curr_ifile != NULL_IFILE) + old_ifile = was_curr_ifile; curr_ifile = ifile; curr_altfilename = alt_filename; @@ -378,19 +386,12 @@ { gfilelist = glob(filename); - if (gfilelist == NULL) + init_textlist(&tl_gfiles, gfilelist); + gfilename = NULL; + while ((gfilename = forw_textlist(&tl_gfiles, gfilename)) != NULL) { - if (edit(filename) == 0 && good_filename == NULL) + if (edit(gfilename) == 0 && good_filename == NULL) good_filename = get_filename(curr_ifile); - } else - { - init_textlist(&tl_gfiles, gfilelist); - gfilename = NULL; - while ((gfilename = forw_textlist(&tl_gfiles, gfilename)) != NULL) - { - if (edit(gfilename) == 0 && good_filename == NULL) - good_filename = get_filename(curr_ifile); - } - free(gfilelist); } + free(gfilelist); } /* diff -U2 less-278/filename.c less-290/filename.c --- less-278/filename.c Tue Jan 31 18:55:39 1995 +++ less-290/filename.c Wed Mar 8 13:57:16 1995 @@ -41,73 +41,78 @@ /* - * Return the full pathname of the given file in the "home directory". + * Return a pathname that points to a specified file in a specified directory. + * Return NULL if the file does not exist in the directory. */ - public char * -homefile(filename) + static char * +dirfile(dirname, filename) + char *dirname; char *filename; { - register char *pathname; - register char *homedir; + char *pathname; + int f; -#if MSOFTC + if (dirname == NULL || *dirname == '\0') + return (NULL); /* - * If $HOME is not defined, look for the file anywhere on search path. + * Construct the full pathname. */ - homedir = getenv("HOME"); - pathname = NULL; - if (homedir != NULL) - { - /* - * Found $HOME. - */ - pathname = (char *) calloc(strlen(homedir)+strlen(filename)+2, + pathname = (char *) calloc(strlen(dirname) + strlen(filename) + 2, sizeof(char)); - if (pathname == NULL) - return (NULL); - sprintf(pathname, "%s\\%s", homedir, filename); - if (access(pathname, 0) < 0) - { - free(pathname); - pathname = NULL; - } - } - if (pathname == NULL) - { - - pathname = (char *) calloc(_MAX_PATH, sizeof(char)); - _searchenv(filename, "PATH", pathname); - if (*pathname == '\0') - - { - free(pathname); - pathname = NULL; - } - } - -#else -#if OS2 - pathname = (char *) calloc(256, sizeof(char)); if (pathname == NULL) return (NULL); - _searchenv(filename, "INIT", pathname); - if (pathname[0] == '\0') - _searchenv(filename, "PATH", pathname); - if (pathname[0] == '\0') +#if MSOFTC || OS2 + sprintf(pathname, "%s\\%s", dirname, filename); +#else + sprintf(pathname, "%s/%s", dirname, filename); +#endif + /* + * Make sure the file exists. + */ + f = open(pathname, OPEN_READ); + if (f < 0) { free(pathname); - return (NULL); + pathname = NULL; + } else + { + close (f); } -#else - homedir = getenv("HOME"); - if (homedir == NULL) - return (NULL); - pathname = (char *) calloc(strlen(homedir)+strlen(filename)+2, - sizeof(char)); - if (pathname == NULL) - return (NULL); - sprintf(pathname, "%s/%s", homedir, filename); + return (pathname); +} + +/* + * Return the full pathname of the given file in the "home directory". + */ + public char * +homefile(filename) + char *filename; +{ + register char *pathname; + + /* + * Try $HOME/filename. + */ + pathname = dirfile(getenv("HOME"), filename); + if (pathname != NULL) + return (pathname); +#if OS2 + /* + * Try $INIT/filename. + */ + pathname = dirfile(getenv("INIT"), filename); + if (pathname != NULL) + return (pathname); #endif +#if MSOFTC || OS2 + /* + * Look for the file anywhere on search path. + */ + pathname = (char *) calloc(_MAX_PATH, sizeof(char)); + _searchenv(filename, "PATH", pathname); + if (*pathname != '\0') + return (pathname); + free(pathname); #endif - return (pathname); + return (NULL); } @@ -152,4 +157,9 @@ { case '%': + if (curr_ifile == NULL_IFILE) + { + /* error("No current file", NULL_PARG); */ + return (save(s)); + } n += strlen(get_filename(curr_ifile)); break; @@ -157,6 +167,6 @@ if (old_ifile == NULL_IFILE) { - error("No previous file", NULL_PARG); - return (NULL); + /* error("No previous file", NULL_PARG); */ + return (save(s)); } n += strlen(get_filename(old_ifile)); @@ -231,5 +241,5 @@ #endif s = glob(fpat); - if (s != NULL && strcmp(s,fpat) == 0) + if (strcmp(s,fpat) == 0) { /* @@ -379,6 +389,4 @@ filename = fexpand(filename); - if (filename == NULL) - return (NULL); #if OS2 { @@ -388,4 +396,6 @@ list = _fnexplode(filename); + if (list == NULL) + return (filename); length = 0; for (cnt = 0; list[cnt] != NULL; cnt++) @@ -416,9 +426,12 @@ return (filename); } - free(filename); gfilename = readfd(fd); pclose(fd); if (*gfilename == '\0') - return (NULL); + { + free(gfilename); + return (filename); + } + free(filename); } #endif @@ -475,8 +488,11 @@ f = fileno(fd); if (read(f, &c, 1) != 1) + { /* * Pipe is empty. This means there is no alt file. */ + pclose(fd); return (NULL); + } ch_ungetchar(c); *pfd = (void *) fd; @@ -536,6 +552,4 @@ filename = fexpand(filename); - if (filename == NULL) - return (NULL); if (_dos_findfirst(filename, ~0, &fnd) != 0) return (filename); diff -U2 less-278/funcs.h less-290/funcs.h --- less-278/funcs.h Tue Jan 31 18:55:41 1995 +++ less-290/funcs.h Thu Mar 9 15:34:21 1995 @@ -6,4 +6,5 @@ public void raw_mode (); public void scrsize (); + public void scrsize (); public void get_editkeys (); public void get_term (); @@ -209,5 +210,4 @@ public void undo_search (); public void clr_hilite (); - public void add_hilite (); public int is_hilited (); public void chg_caseless (); @@ -215,5 +215,4 @@ public int search (); public void prep_hilite (); - public void fake_interrupt (); public RETSIGTYPE winch (); public RETSIGTYPE winch (); diff -U2 less-278/jump.c less-290/jump.c --- less-278/jump.c Tue Jan 31 18:55:45 1995 +++ less-290/jump.c Thu Mar 2 18:05:33 1995 @@ -126,4 +126,9 @@ if ((len = ch_length()) == NULL_POSITION) { + ierror("Determining length of file", NULL_PARG); + ch_end_seek(); + } + if ((len = ch_length()) == NULL_POSITION) + { error("Don't know length of file", NULL_PARG); return; diff -U2 less-278/less.h less-290/less.h --- less-278/less.h Tue Jan 31 18:55:46 1995 +++ less-290/less.h Mon Mar 13 15:39:25 1995 @@ -36,4 +36,13 @@ #include +#ifdef _SEQUENT_ +/* + * Kludge for Sequent Dynix systems that have sigsetmask, but + * it's not compatible with the way less calls it. + * {{ Do other systems need this? }} + */ +#undef HAVE_SIGSETMASK +#endif + /* * Language details. @@ -134,5 +143,5 @@ #if MSOFTC || OS2 -#define OPEN_TTYIN() open("CON", O_TEXT|O_RDONLY) +#define OPEN_TTYIN() open("CON", O_BINARY|O_RDONLY) #else #define OPEN_TTYIN() open("/dev/tty", 0) diff -U2 less-278/less.man less-290/less.man --- less-278/less.man Tue Feb 14 13:22:00 1995 +++ less-290/less.man Thu Mar 2 16:15:09 1995 @@ -12,5 +12,5 @@ less -? less -V - less [-[+]aBcCdeEfgGHiImMnNqQrsSuUw] + less [-[+]aBcCdeEfgGiImMnNqQrsSuUVwX] [-b _b_u_f_s] [-h _l_i_n_e_s] [-j _l_i_n_e] [-k _k_e_y_f_i_l_e] [-{oO} _l_o_g_f_i_l_e] [-p _p_a_t_t_e_r_n] [-P _p_r_o_m_p_t] [-t _t_a_g] diff -U2 less-278/less.nro less-290/less.nro --- less-278/less.nro Tue Feb 14 13:21:46 1995 +++ less-290/less.nro Thu Mar 2 16:15:01 1995 @@ -7,5 +7,5 @@ .B "less -V" .br -.B "less [-[+]aBcCdeEfgGHiImMnNqQrsSuUw]" +.B "less [-[+]aBcCdeEfgGiImMnNqQrsSuUVwX]" .br .B " [-b \fIbufs\fP] [-h \fIlines\fP] [-j \fIline\fP] [-k \fIkeyfile\fP]" diff -U2 less-278/lesskey.c less-290/lesskey.c --- less-278/lesskey.c Tue Jan 31 18:55:52 1995 +++ less-290/lesskey.c Mon Mar 6 15:50:14 1995 @@ -204,7 +204,7 @@ C2_END_LESSKEY_MAGIC }; -char cmdsection[] = { CMD_SECTION }; -char editsection[] = { EDIT_SECTION }; -char endsection[] = { END_SECTION }; +char cmdsection[1] = { CMD_SECTION }; +char editsection[1] = { EDIT_SECTION }; +char endsection[1] = { END_SECTION }; char *infile = NULL; @@ -244,13 +244,11 @@ char *pathname; + if ((p = getenv("HOME")) != NULL && *p != '\0') + pathname = mkpathname(p, filename); #if OS2 - if ((p = getenv("INIT")) != NULL && *p != '\0') + else if ((p = getenv("INIT")) != NULL && *p != '\0') pathname = mkpathname(p, filename); - else #endif - if ((p = getenv("HOME")) != NULL && *p != '\0') - { - pathname = mkpathname(p, filename); - } else + else { fprintf(stderr, "cannot find $HOME - using current directory\n"); @@ -665,5 +663,5 @@ if (outfile == NULL) outfile = homefile(LESSKEYFILE); - if ((out = fopen(outfile, "w")) == NULL) + if ((out = fopen(outfile, "wb")) == NULL) { perror(outfile); diff -U2 less-278/line.c less-290/line.c --- less-278/line.c Tue Jan 31 18:55:57 1995 +++ less-290/line.c Fri Feb 24 15:12:21 1995 @@ -395,5 +395,5 @@ * of the character on this line. */ - if (column + strlen(s) + + if (column + (int) strlen(s) + attr_swidth(a) + attr_ewidth(a) > sc_width) return (1); diff -U2 less-278/main.c less-290/main.c --- less-278/main.c Tue Jan 31 18:56:00 1995 +++ less-290/main.c Thu Mar 23 14:23:17 1995 @@ -90,4 +90,5 @@ * Command line arguments override environment arguments. */ + get_term(); init_cmds(); init_prompt(); @@ -96,4 +97,16 @@ scan_option(getenv("LESS")); +#if GNU_OPTIONS + /* + * Special case for "less --help" and "less --version". + */ + if (argc == 2) + { + if (strcmp(argv[0], "--help") == 0) + scan_option("-?"); + if (strcmp(argv[0], "--version") == 0) + scan_option("-V"); + } +#endif #define isoptstring(s) (((s)[0] == '-' || (s)[0] == '+') && (s)[1] != '\0') while (--argc > 0 && (isoptstring(argv[0]) || isoptpending())) @@ -143,6 +156,4 @@ gfilename = glob(*argv++); - if (gfilename == NULL) - continue; init_textlist(&tlist, gfilename); filename = NULL; @@ -179,6 +190,4 @@ init_mark(); raw_mode(1); - get_term(); - get_editkeys(); open_getchr(); init_signals(1); diff -U2 less-278/optfunc.c less-290/optfunc.c --- less-278/optfunc.c Tue Jan 31 18:56:03 1995 +++ less-290/optfunc.c Fri Feb 24 15:29:37 1995 @@ -60,5 +60,4 @@ extern int force_logfile; extern int logfile; -extern char *glob(); #endif #if TAGS @@ -106,6 +105,4 @@ s = skipsp(s); namelogfile = glob(s); - if (namelogfile == NULL) - namelogfile = save(s); use_logfile(namelogfile); sync_logfile(); @@ -239,6 +236,4 @@ s = skipsp(s); tags = glob(s); - if (tags == NULL) - tags = save(s); break; case QUERY: diff -U2 less-278/search.c less-290/search.c --- less-278/search.c Tue Jan 31 18:56:16 1995 +++ less-290/search.c Fri Mar 10 01:04:24 1995 @@ -77,4 +77,5 @@ }; static struct hilite hilite_anchor = { NULL }; +#define hl_first hl_next #endif @@ -384,62 +385,14 @@ struct hilite *nexthl; - for (hl = hilite_anchor.hl_next; hl != NULL; hl = nexthl) + for (hl = hilite_anchor.hl_first; hl != NULL; hl = nexthl) { nexthl = hl->hl_next; free((void*)hl); } - hilite_anchor.hl_next = NULL; + hilite_anchor.hl_first = NULL; prep_startpos = prep_endpos = NULL_POSITION; } /* - * Add a new hilite to the hilite list. - */ - public void -add_hilite(startpos, endpos) - POSITION startpos; - POSITION endpos; -{ - struct hilite *hl; - struct hilite *ihl; - - /* - * Hilites are sorted in the list; find where new one belongs. - * Insert new one after ihl. - */ - for (ihl = &hilite_anchor; ihl->hl_next != NULL; ihl = ihl->hl_next) - { - if (ihl->hl_next->hl_startpos > startpos) - break; - } - - if (ihl != &hilite_anchor && startpos <= ihl->hl_endpos) - { - /* - * New hilite starts within existing ihl. - * Just extend ihl to end at the new hilite's end. - */ - ihl->hl_endpos = MAXPOS(endpos, ihl->hl_endpos); - } else - { - /* - * Add new hilite after ihl. - */ - hl = (struct hilite *) ecalloc(1, sizeof(struct hilite)); - hl->hl_startpos = startpos; - /* - * If new hilite ends within the one after ihl, - * truncate it to end at the start of that one. - */ - if (ihl->hl_next == NULL) - hl->hl_endpos = endpos; - else - hl->hl_endpos = MINPOS(endpos, ihl->hl_next->hl_startpos); - hl->hl_next = ihl->hl_next; - ihl->hl_next = hl; - } -} - -/* * Should any characters in a specified range be highlighted? * If nohide is nonzero, don't consider hide_hilite. @@ -468,5 +421,5 @@ * Look at each highlight and see if any part of it falls in the range. */ - for (hl = hilite_anchor.hl_next; hl != NULL; hl = hl->hl_next) + for (hl = hilite_anchor.hl_first; hl != NULL; hl = hl->hl_next) { if (hl->hl_endpos > pos && @@ -478,8 +431,49 @@ /* + * Add a new hilite to a hilite list. + */ + static void +add_hilite(anchor, hl) + struct hilite *anchor; + struct hilite *hl; +{ + struct hilite *ihl; + + /* + * Hilites are sorted in the list; find where new one belongs. + * Insert new one after ihl. + */ + for (ihl = anchor; ihl->hl_next != NULL; ihl = ihl->hl_next) + { + if (ihl->hl_next->hl_startpos > hl->hl_startpos) + break; + } + + /* + * Truncate hilite so it doesn't overlap any existing ones + * above and below it. + */ + if (ihl != anchor) + hl->hl_startpos = MAXPOS(hl->hl_startpos, ihl->hl_endpos); + if (ihl->hl_next != NULL) + hl->hl_endpos = MINPOS(hl->hl_endpos, ihl->hl_next->hl_startpos); + if (hl->hl_startpos >= hl->hl_endpos) + { + /* + * Hilite was truncated out of existence. + */ + free(hl); + return; + } + hl->hl_next = ihl->hl_next; + ihl->hl_next = hl; +} + +/* * Adjust hl_startpos & hl_endpos to account for backspace processing. */ static void -adj_hilite(linepos) +adj_hilite(anchor, linepos) + struct hilite *anchor; POSITION linepos; { @@ -499,11 +493,6 @@ (void) forw_raw_line(linepos, &line); opos = npos = linepos; - /* - * Find the first hilite in (or after) this line. - */ - for (hl = hilite_anchor.hl_next; hl != NULL; hl = hl->hl_next) - if (hl->hl_startpos >= linepos) - break; - checkstart = 1; + hl = anchor->hl_first; + checkstart = TRUE; while (hl != NULL) { @@ -518,10 +507,10 @@ { hl->hl_startpos = npos; - checkstart = 0; + checkstart = FALSE; continue; /* {{ not really necessary }} */ } else if (!checkstart && hl->hl_endpos == opos) { hl->hl_endpos = npos; - checkstart = 1; + checkstart = TRUE; hl = hl->hl_next; continue; /* {{ necessary }} */ @@ -532,5 +521,5 @@ npos++; line++; - if (line[0] == '\b' && line[1] != '\0') + while (line[0] == '\b' && line[1] != '\0') { /* @@ -558,4 +547,6 @@ { char *searchp; + struct hilite *hl; + struct hilite hilites; if (sp == NULL || ep == NULL) @@ -570,4 +561,8 @@ */ searchp = line; + /* + * Put the hilites into a temporary list until they're adjusted. + */ + hilites.hl_first = NULL; do { if (ep > sp) @@ -578,5 +573,8 @@ * This is not quite true; we need to adjust later. */ - add_hilite(linepos + (sp-line), linepos + (ep-line)); + hl = (struct hilite *) ecalloc(1, sizeof(struct hilite)); + hl->hl_startpos = linepos + (sp-line); + hl->hl_endpos = linepos + (ep-line); + add_hilite(&hilites, hl); } /* @@ -600,5 +598,13 @@ * {{ This is very ugly. }} */ - adj_hilite(linepos); + adj_hilite(&hilites, linepos); + } + /* + * Now put the hilites into the real list. + */ + while ((hl = hilites.hl_next) != NULL) + { + hilites.hl_next = hl->hl_next; + add_hilite(&hilite_anchor, hl); } } @@ -903,5 +909,5 @@ } #if HILITE_SEARCH - if (hilite_search == 1) + if (hilite_search == OPT_ON) { /* @@ -910,6 +916,15 @@ */ repaint_hilite(0); + } + if (hilite_search == OPT_ONPLUS && hide_hilite) + { + /* + * Highlight any matches currently on screen, + * before we actually start the search. + */ hide_hilite = 0; + hilite_screen(); } + hide_hilite = 0; #endif } else diff -U2 less-278/version.c less-290/version.c --- less-278/version.c Wed Feb 15 01:15:36 1995 +++ less-290/version.c Mon Mar 13 17:07:07 1995 @@ -27,468 +27,487 @@ /* - * ----------------------- CHANGE HISTORY -------------------------- - * - * Allowed use on standard input 1/29/84 markn - * Added E, N, P commands 2/1/84 markn - * Added '=' command, 'stop' signal handling 4/17/84 markn - * Added line folding 4/20/84 markn - * v2: Fixed '=' command to use BOTTOM_PLUS_ONE, - * instead of TOP, added 'p' & 'v' commands 4/27/84 markn - * v3: Added -m and -t options, '-' command 5/3/84 markn - * v4: Added LESS environment variable 5/3/84 markn - * v5: New comments, fixed '-' command slightly 5/3/84 markn - * v6: Added -Q, visual bell 5/15/84 markn - * v7: Fixed jump_back(n) bug: n should count real - * lines, not folded lines. Also allow number - * on G command. 5/24/84 markn - * v8: Re-do -q and -Q commands 5/30/84 markn - * v9: Added "+" argument 9/25/84 markn - * v10: Fixed bug in -b argument processing 10/10/84 markn - * v11: Made error() ring bell if \n not entered. 10/18/84 markn - * ----------------------------------------------------------------- - * v12: Reorganized signal handling and made - * portable to 4.2bsd. 2/13/85 mark - * v13: Reword error message for '-' command. 2/16/85 mark - * v14: Added -bf and -bp variants of -b. 2/22/85 mark - * v15: Miscellaneous changes. 2/25/85 mark - * v16: Added -u flag for backspace processing. 3/13/85 mark - * v17: Added j and k commands, - * changed -t default. 4/13/85 mark - * v18: Rewrote signal handling code. 4/20/85 mark - * v19: Got rid of "verbose" eq_message(). 5/2/85 mark - * Made search() scroll in some cases. - * v20: Fixed screen.c ioctls for System V. 5/21/85 mark - * v21: Fixed some first_cmd bugs. 5/23/85 mark - * v22: Added support for no RECOMP nor REGCMP. 5/24/85 mark - * v23: Miscellanous changes and prettying up. 5/25/85 mark - * Posted to USENET. - * ----------------------------------------------------------------- - * v24: Added ti,te terminal init & de-init 6/3/85 Mike Kersenbrock - * v25: Added -U flag, standout mode underlining. 6/8/85 mark - * v26: Added -M flag. 6/9/85 mark - * Use underline termcap (us) if it exists. - * v27: Renamed some variables to make unique in 6/15/85 mark - * 6 chars. Minor fix to -m. - * v28: Fixed right margin bug. 6/28/85 mark - * v29: Incorporated M.Rose's changes to signal.c 6/28/85 mark - * v30: Fixed stupid bug in argument processing. 6/29/85 mark - * v31: Added -p flag, changed repaint algorithm. 7/15/85 mark - * Added kludge for magic cookie terminals. - * v32: Added cat_file if output not a tty. 7/16/85 mark - * v33: Added -e flag and EDITOR. 7/23/85 mark - * v34: Added -s flag. 7/26/85 mark - * v35: Rewrote option handling; added option.c. 7/27/85 mark - * v36: Fixed -e flag to work if not last file. 7/29/85 mark - * v37: Added -x flag. 8/10/85 mark - * v38: Changed prompting; created prompt.c. 8/19/85 mark - * v39: (Not -p) does not initially clear screen. 8/24/85 mark - * v40: Added "skipping" indicator in forw(). 8/26/85 mark - * Posted to USENET. - * ----------------------------------------------------------------- - * v41: ONLY_RETURN, control char commands, 9/17/85 mark - * faster search, other minor fixes. - * v42: Added ++ command line syntax; 9/25/85 mark - * ch_fsize for pipes. - * v43: Added -h flag, changed prim.c algorithms. 10/15/85 mark - * v44: Made END print in all cases of eof; 10/16/85 mark - * ignore SIGTTOU after receiving SIGTSTP. - * v45: Never print backspaces unless -u. 10/16/85 mark - * v46: Backwards scroll in jump_loc. 10/24/85 mark - * v47: Fixed bug in edit(): *first_cmd==0 10/30/85 mark - * v48: Use TIOCSETN instead of TIOCSETP. 11/16/85 mark - * Added marks (m and ' commands). - * Posted to USENET. - * ----------------------------------------------------------------- - * v49: Fixed bug: signal didn't clear mcc. 1/9/86 mark - * v50: Added ' (quote) to gomark. 1/15/86 mark - * v51: Added + cmd, fixed problem if first_cmd - * fails, made g cmd sort of "work" on pipes - * even if bof is no longer buffered. 1/16/86 mark - * v52: Made short files work better. 1/17/86 mark - * v53: Added -P option. 1/20/86 mark - * v54: Changed help to use HELPFILE. 1/20/86 mark - * v55: Messages work better if not tty output. 1/23/86 mark - * v56: Added -l option. 1/24/86 mark - * v57: Fixed -l to get confirmation before - * overwriting an existing file. 1/31/86 mark - * v58: Added filename globbing. 8/28/86 mark - * v59: Fixed some bugs with very long filenames. 9/15/86 mark - * v60: Incorporated changes from Leith (Casey) - * Leedom for boldface and -z option. 9/26/86 mark - * v61: Got rid of annoying repaints after ! cmd. 9/26/86 mark - * Posted to USENET. - * ----------------------------------------------------------------- - * v62: Added is_directory(); change -z default to - * -1 instead of 24; cat-and-exit if -e and - * file is less than a screenful. 12/23/86 mark - * v63: Fixed bug in cat-and-exit if > 1 file. 1/8/87 mark - * v64: Changed puts/putstr, putc/putchr, - * getc/getchr to avoid name conflict with - * stdio functions. 1/12/87 mark - * v65: Allowed '-' command to change NUMBER - * valued options (thanks to Gary Puckering) 1/26/87 mark - * v66: Fixed bug: prepaint should use force=1. 2/13/87 mark - * v67: Added !! and % expansion to ! command. 2/24/87 mark - * v68: Added SIGWINCH and TIOCGWINSZ support; - * changed is_directory to bad_file. - * (thanks to J. Robert Ward) 2/25/87 mark - * v69: Added SIGWIND and WIOCGETD (for Unix PC). 2/25/87 mark - * v70: Changed help cmd from 'h' to 'H'; better - * error msgs in bad_file, errno_message. 3/13/87 mark - * v71: Changed -p to -c, made triple -c/-C - * for clear-eol like more's -c. 5/11/87 mark - * v72: Added -E, -L, use $SHELL in lsystem(). 6/26/87 mark - * (thanks to Steve Spearman) - * v73: Allow Examine "#" for previous file. 6/26/87 mark - * Posted to USENET 8/25/87. - * ----------------------------------------------------------------- - * v74: Fix conflict in EOF symbol with stdio.h, 9/18/87 mark - * Make os.c more portable to BSD. - * v75: Fix problems in get_term (thanks to 9/23/87 mark - * Paul Eggert); new backwards scrolling in - * jump_loc (thanks to Marion Hakanson). - * v76: Added -i flag; allow single "!" to 9/23/87 mark - * invoke a shell (thanks to Franco Barber). - * v77: Added -n flag and line number support. 9/24/87 mark - * v78: Fixed problem with prompts longer than 9/25/87 mark - * the screen width. - * v79: Added the _ command. 9/29/87 mark - * v80: Allow signal to break out of linenum scan. 10/6/87 mark - * v81: Allow -b to be changed from within less. 10/6/87 mark - * v82: Add cmd_decode to use a table for key 10/7/87 mark - * binding (thanks to David Nason). - * v83: Allow .less file for user-defined keys. 10/9/87 mark - * v84: Fix -e/-E problems (thanks to Felix Lee). 10/11/87 mark - * v85: Search now keeps track of line numbers. 10/15/87 mark - * v86: Added -B option and autobuf; fixed 10/20/87 mark - * "pipe error" bug. - * v87: Fix bug re BSD signals while reading file. 3/1/88 mark - * v88: Use new format for -P option (thanks to 3/12/88 mark - * der Mouse), allow "+-c" without message, - * fix bug re BSD hangup. - * v89: Turn off line numbers if linenum scan 3/18/88 mark - * is interrupted. - * v90: Allow -P from within less. 3/30/88 mark - * v91: Added tags file support (new -t option) 3/30/88 mark - * (thanks to Brian Campbell). - * v92: Added -+option syntax. 4/4/88 mark - * v93: Add support for slow input (thanks to 4/11/88 mark - * Joe Orost & apologies for taking almost - * 3 years to get this in!) - * v94: Redo reading/signal stuff. 4/11/88 mark - * v95: Repaint screen better after signal. 4/20/88 mark - * v96: Add /! and ?! commands. 4/21/88 mark - * v97: Allow -l/-L from within less. 5/17/88 mark - * Eliminate some static arrays (use calloc). - * Posted to USENET. - * ----------------------------------------------------------------- - * v98: Fix incorrect calloc call; uninitialized 10/14/88 mark - * var in exec_mca; core dump on unknown TERM. - * Make v cmd work if past last line of file. - * Fix some signal bugs. - * v99: Allow space between -X and string, 10/29/88 mark - * when X is a string-valued option. - * v100: Fix globbing bug when $SHELL not set; 1/5/89 mark - * allow spaces after -t command. - * v101: Fix problem with long (truncated) lines 1/6/89 mark - * in tags file (thanks to Neil Dixon). - * v102: Fix bug with E# when no prev file; 1/6/89 mark - * allow spaces after -l command. - * v103: Add -N, -f and -? options. Add z and w 3/14/89 mark - * commands. Add %L for prompt strings. - * v104: Added EDITPROTO. 3/16/89 mark - * v105: Fix bug in find_linenum which cached 3/20/89 mark - * incorrectly on long lines. - * v106: Added -k option and multiple lesskey 3/31/89 mark - * files. - * v107: Add 8-bit char support and -g option. 4/27/89 mark - * Split option code into 3 files. - * v108: Allocate position table dynamically 5/5/89 mark - * (thanks to Paul Eggert); change % command - * from "percent" to vi-style brace finder. - * v109: Added ESC-% command, split prim.c. 5/10/89 mark - * v110: Fixed bug in + option; fixed repaint bug 5/24/89 mark - * under Sun windows (thanks to Paul Eggert). - * v111: Generalized # and % expansion; use 5/25/89 mark - * calloc for some error messages. - * v112: Get rid of ESC-%, add {}()[] commands. 5/30/89 mark - * v113: Optimize lseeks (thanks to Paul Eggert). 5/31/89 mark - * v114: Added ESC-/ and ESC-/! commands. 7/25/89 mark - * v115: Added ESC-n command. 7/26/89 mark - * v116: Added find_pos to optimize g command. 7/31/89 mark - * v117: Change -f option to -r. 8/1/89 mark - * v118: Save positions for all previous files, 8/2/89 mark - * not just the immediately previous one. - * v119: Save marks across file boundaries. 8/7/89 mark - * Add file handle stuff. - * v120: Add :ta command. 8/11/89 mark - * v121: Add -f option. 8/16/89 mark - * v122: Fix performance with many buffers. 8/30/89 mark - * v123: Verbose prompts for string options. 8/31/89 mark - * Posted beta to USENET. - * ----------------------------------------------------------------- - * v124: Reorganize search commands, 9/18/89 mark - * N = rev, ESC-n = span, add ESC-N. - * v125: Fix tab bug (thanks to Alex Liu). 9/18/89 mark - * Fix EOF bug when both -w and -c. - * v126: Add -j option. 10/25/89 mark - * v127: Fix problems with blank lines before BOF. 10/27/89 mark - * v128: Add %bj, etc. to prompt strings. 10/27/89 mark - * v129: Add -+,-- commands; add set-option and 11/3/89 mark - * unset-option to lesskey. - * v130: Generalize A_EXTRA to string, remove 11/6/89 mark - * set-option, unset-option from lesskey. - * v131: Changed name of EDITPROTO to LESSEDIT. 11/7/89 mark - * v132: Allow editing of command prefix. 11/8/89 mark - * v133: Add -y option (thanks to Jeff Sullivan). 11/16/89 mark - * v134: Glob filenames in the -l command. 12/1/89 mark - * v135: Combined {}()[] commands into one, and 12/5/89 mark - * added ESC-^F and ESC-^B commands. - * v136: Added -S, -R flags. Added | command. 1/20/90 mark - * Added warning for binary files. (thanks - * to Richard Brittain and J. Sullivan). - * v137: Rewrote horrible pappend code. 1/21/90 mark - * Added * notation for hi-bit chars. - * v138: Fix magic cookie terminal handling. 1/24/90 mark - * Get rid of "cleanup" loop in ch_get. - * v139: Added MSDOS support. (many thanks 1/27/90 mark - * to Richard Brittain). - * v140: Editing a new file adds it to the 2/7/90 mark - * command line list. - * v141: Add edit_list for editing >1 file. 2/8/90 mark - * v142: Add :x command. 2/10/90 mark - * v143: Add * and @ modifies to search cmds. 2/11/90 mark - * Change ESC-/ cmd from /@* to / *. - * v144: Messed around with ch_zero; 3/1/90 mark - * no real change. - * v145: Added -R and -v/-V for MSDOS; 3/2/90 mark - * renamed FILENAME to avoid conflict. - * v146: Pull cmdbuf functions out of command.c 3/5/90 mark - * v147: Implement ?@; fix multi-file edit bugs. 3/7/90 mark - * v148: Fixed bug in :e then :e#. 3/29/90 mark - * v149: Change error,ierror,query to use PARG. 4/3/90 mark - * v150: Add LESS_CHARSET, LESS_CHARDEF. 4/6/90 mark - * v151: Remove -g option; clean up ispipe. 4/13/90 mark - * v152: lsystem() closes input file, for 4/14/90 mark - * editors which require exclusive open. - * v153: Fix bug if SHELL unset; 4/18/90 mark - * fix bug in overstrike control char. - * v154: Output to fd 2 via buffer. 4/25/90 mark - * v155: Ignore -i if uppercase in pattern 4/30/90 mark - * (thanks to Michael Rendell.) - * v156: Remove scroll limits in forw() & back(); 5/3/90 mark - * causes problems with -c. - * v157: Forward search starts at next real line 5/4/90 mark - * (not screen line) after jump target. - * v158: Added F command. 6/14/90 mark - * v159: Fix bug in exiting: output not flushed. 7/29/90 mark - * v160: Clear screen before initial output w/ -c. 7/29/90 mark - * v161: Add -T flag. 7/29/90 mark - * v162: Fix bug with +F on command line. 8/14/90 mark - * v163: Added LESSBINFMT variable. 8/21/90 mark - * v164: Added -p, LINES, COLUMNS and 9/5/90 mark - * unset mark ' == BOF, for 1003.2 D5. - * v165: At EOF with -c set, don't display empty 9/6/90 mark - * screen when try to page forward. - * v166: Fix G when final line in file wraps. 9/6/90 mark - * v167: Translate CR/LF -> LF for 1003.2. 9/11/90 mark - * v168: Return to curr file if "tag not found". 9/13/90 mark - * v169: G goes to EOF even if file has grown. 12/12/90 mark - * v170: Add optimization for BSD _setjmp; 1/17/91 mark - * fix #include ioctl.h TERMIO problem. - * (thanks to Paul Eggert) - * Posted to USENET. - * ----------------------------------------------------------------- - * v171: Fix -? bug in get_filename. 3/6/91 mark - * v172: Fix G bug in empty file. 3/15/91 mark - * Fix bug with ?\n and -i and uppercase - * pattern at EOF! - * (thanks to Paul Eggert) - * v173: Change N cmd to not permanently change 3/17/91 mark - * direction. (thanks to Brian Matthews) - * v174: Fix bug with namelogfile not getting 3/18/91 mark - * cleared when change files. - * v175: Fix bug with ++cmd on command line. 3/18/91 mark - * (thanks to Jim Meyering) - * v176: Change | to not force current screen, 4/2/91 mark - * include marked line, start/end from - * top of screen. Improve search speed. - * (thanks to Don Mears) - * v177: Add LESSHELP variable. 4/2/91 mark - * Fix bug with F command with -e. - * Try /dev/tty for input before using fd 2. - * Patches posted to USENET 4/2/91. - * ----------------------------------------------------------------- - * v178: Fixed bug in globbing logfile name. 4/8/91 - * (thanks to Jim Meyering) - * v179: Allow negative -z for screen-relative. 4/9/91 - * v180: Clear to eos rather than eol if "db"; 4/9/91 - * don't use "sr" if "da". - * (thanks to Tor Lillqvist) - * v181: Fixed bug with "negative" chars 80 - FF. 4/18/91 - * (thanks to Benny Sander Hofmann) - * v182: Fixed bug with attribute at EOL. 5/16/91 - * (thanks to Brian Matthews) - * v183: Rewrite linstall to do smart config. 6/1/91 - * v184: Process \b in searches based on -u 7/11/91 - * rather than -i. - * v185: -Pxxx sets short prompt; assume SIGWINCH 7/11/91 - * after a SIGSTOP. (thanks to Ken Laprade) - * ----------------------------------------------------------------- - * v186: Port to MS-DOS (Microsoft C). 4/20/92 - * v187: Added -D option & TAB_COMPLETE_FILENAME. 4/23/92 - * v188: Added command line editing features. 4/28/92 - * v189: Fix mem overrun in anscreen.c:init; 12/8/92 - * fix edit_list to recover from bin file. - * v190: Make TAB enter one filename at a time; 2/13/93 - * create ^L with old TAB functionality. - * v191: Defer creating "flash" page for MS-DOS. 3/10/93 - * v192: Add BACK-TAB. 9/6/93 - * v193: Simplify binary_file handling. 9/17/93 - * v194: Add rudiments of alt_filename handling. 1/4/94 - * v195: Port back to Unix; support keypad. 1/11/94 - * ----------------------------------------------------------------- - * v196: Fix bug with bad filename; fix IFILE 6/7/94 - * type problem. (thanks to David MacKenzie) - * v197: Fix bug with .less tables inserted wrong. 6/7/94 - * v198: Use autoconf installation technology. 6/23/94 - * (thanks to David MacKenzie) - * v199: Fix MS-DOS build (thanks to Tim Wiegman). 6/29/94 - * v200: Clean up copyright, minor fixes. 7/25/94 - * Posted to prep.ai.mit.edu - * ----------------------------------------------------------------- - * v201: Check for no memcpy; add casts to calloc; 7/27/94 - * look for regcmp in libgen.a. - * (thanks to Kaveh Ghazi). - * v202: Fix bug in edit_next/edit_prev with 7/28/94 - * non-existant files. - * v203: Fix a variety of configuration bugs on 8/2/94 - * various systems. (thanks to Sakai - * Kiyotaka, Harald Koenig, Bjorn Brox, - * Teemu Rantanen, and Thorsten Lockert) - * v204: Use strerror if available. 8/3/94 - * (thanks to J.T. Conklin) - * v205: Fix bug in finding "me" termcap entry. 8/5/94 - * (thanks to Andreas Stolcke) - * v205+: Change BUFSIZ to LBUFSIZE to avoid name 8/10/94 - * conflict with stdio.h. - * Posted to prep.ai.mit.edu - * ----------------------------------------------------------------- - * v206: Use initial_scrpos for -t to avoid 8/10/94 - * displaying first page before init(). - * (thanks to Dominique Petitpierre) - * v207: Fix bug if stdout is not tty. 8/12/94 - * v208: Fix bug in close_altfile if goto err1 8/16/94 - * in edit_ifile. (Thanks to M.J. Hewitt) - * v209: Change scroll to wscroll to avoid 8/16/94 - * conflict with library function. - * v210: Fix bug with bold on 8 bit chars. 8/16/94 - * (thanks to Vitor Duarte) - * v211: Don't quit on EOI in jump_loc / forw. 8/16/94 - * v212: Use time_t if available. 8/18/94 - * v213: Allow ospeed to be defined in termcap.h. 8/20/94 - * v214: Added HILITE_SEARCH, -F, ESC-u cmd. 8/20/94 - * (thanks to Paul Lew and Bob Byrnes) - * v215: Fix -i toggle behavior. 8/23/94 - * v216: Process BS in all searches, not only -u. 8/23/94 - * v217: Added -X flag. 8/24/94 - * v218: Reimplement undo_search. 8/24/94 - * v219: Find tags marked with line number 8/24/94 - * instead of pattern. - * v220: Stay at same position after SIG_WINCH. 8/24/94 - * v221: Fix bug in file percentage in big file. 8/24/94 - * v222: Do better if can't reopen current file. 8/25/94 - * v223: Support setlocale. 8/27/94 - * (thanks to Robert Joop) - * v224: Revert v216: process BS in search 8/29/94 - * only if -u. - * v225: Rewrite undo_search again: toggle. 9/6/94 - * v226: Configuration fixes. 9/15/94 - * (thanks to David MacKenzie) - * v227: Fixed strerror config problem. 9/19/94 - * Posted to prep.ai.mit.edu - * ----------------------------------------------------------------- - * v228: Fix bug in signals: repeated calls to 9/21/94 - * get_editkeys overflowed st_edittable. - * v229: Fix "Nothing to search" error if -a 9/21/94 - * and SRCH_PAST_EOF. - * v230: Don't print extra error msg in search 9/21/94 - * after regerror(). - * v231: Fix hilite bug if search matches 0 chars. 9/22/94 - * (thanks to John Polstra) - * v232: Deal with weird systems that have 9/23/94 - * termios.h but not tcgetattr(). - * Posted to prep.ai.mit.edu - * ----------------------------------------------------------------- - * v233: Use get_term() instead of pos_init() in 9/26/94 - * psignals to re-get lower_left termcap. - * (Thanks to John Malecki) - * v234: Make MIDDLE closer to middle of screen. 9/26/94 - * v235: Use local strchr if system doesn't have. 9/27/94 - * v236: Don't use libucb; use libterm if 9/28/94 - * libtermcap & libcurses doesn't work. - * (Fix for Solaris; thanks to Frank Kaefer) - * v237: Use system isupper() etc if provided. 9/30/94 - * Posted to prep.ai.mit.edu - * ----------------------------------------------------------------- - * v238: Make binary non-blinking if LESSBINFMT 10/6/94 - * is set to a string without a *. - * v239: Don't let delimit_word run back past 10/7/94 - * beginning of cmdbuf. - * v240: Don't write into termcap buffer. 10/10/94 - * (Thanks to Benoit Speckel) - * v241: New lesskey file format. 10/13/94 - * Don't expand filenames in search command. - * v242: Allow lesskey specification of "literal". 10/14/94 - * v243: Add #stop command to lesskey. 10/14/94 - * v244: Add -f flag to lesskey. 10/16/94 - * v245: Allow TAB_COMPLETE_FILENAME to be undefd. 10/25/94 - * v246: Move help file to /usr/local/share. 10/27/94 - * v247: Add -V option. 10/27/94 - * v248: Add -V option to lesskey. 11/5/94 - * v249: Remove -f flag from lesskey; default 11/5/94 - * input file is ~/.lesskey.in, not stdin. - * v250: Lesskey input file "-" means stdin. 11/7/94 - * v251: Convert cfgetospeed result to ospeed. 11/9/94 - * (Thanks to Andrew Chernov) - * v252: Change default lesskey input file from 11/16/94 - * .lesskey.in to .lesskey. - * Posted to prep.ai.mit.edu - * ----------------------------------------------------------------- - * v253: Fix bug when tags file has a backslash. 11/21/94 - * v254: Fix -k option. 12/6/94 - * v255: Add #define EXAMINE to disable :e etc. 12/8/94 - * v256: Change highlighting: only highlite search 12/10/94 - * results (but now it is reliable). - * v257: Add goto_line and repaint_highlight 12/10/94 - * to optimize highlight repaints. - * v258: Fixup in hilite_line if BS_SPECIAL. 12/12/94 - * v259: Convert to autoconf 2.0. 12/12/94 - * v260: Add SECURE define. 12/13/94 - * v261: Use system WERASE char as EC_W_BACKSPACE. 12/14/94 - * v262: Add -g/-G flag and screen_hilite. 12/16/94 - * v263: Reimplement/optimize -G flag behavior. 12/20/94 - * v264: Allow EXTRA string after line-edit cmd 12/23/94 - * in lesskey file. - * v265: Add LESSOPEN=|cmd syntax. 12/24/94 - * v266: Add -I flag. 12/26/94 - * v267: Formalize the four-byte header emitted 12/28/94 - * by a LESSOPEN pipe. - * v268: Get rid of four-byte header. 12/28/94 - * v269: Close alt file before open new one. 1/2/95 - * Avoids multiple popen(). - * v270: Use VISUAL; use S_ISDIR/S_ISREG; fix 1/3/95 - * config problem with Solaris POSIX regcomp. - * v271: Don't quit on read error. 1/4/95 - * v272: Get rid of -L. 1/5/95 - * v273: Fix ch_ungetchar bug; don't call 1/6/95 - * LESSOPEN on a pipe. - * v274: Ported to OS/2 (thanks to Kai Uwe Rommel) 1/6/95 - * v275: Fix bug if toggle -G at EOF. 1/18/95 - * v276: Fix OS/2 version. 1/30/95 - * v277: Add "next" charset; don't display ^X 1/31/95 - * for X > 128. - * v278: Change default for -G. 2/14/95 - */ +----------------------- CHANGE HISTORY -------------------------- -char version[] = "278"; + 1/29/84 Allowed use on standard input + 2/1/84 Added E, N, P commands + 4/17/84 Added '=' command, 'stop' signal handling + 4/20/84 Added line folding +v2 4/27/84 Fixed '=' command to use BOTTOM_PLUS_ONE, + instead of TOP, added 'p' & 'v' commands +v3 5/3/84 Added -m and -t options, '-' command +v4 5/3/84 Added LESS environment variable +v5 5/3/84 New comments, fixed '-' command slightly +v6 5/15/84 Added -Q, visual bell +v7 5/24/84 Fixed jump_back(n) bug: n should count real + lines, not folded lines. Also allow number on G command. +v8 5/30/84 Re-do -q and -Q commands +v9 9/25/84 Added "+" argument +v10 10/10/84 Fixed bug in -b argument processing +v11 10/18/84 Made error() ring bell if \n not entered. +----------------------------------------------------------------- +v12 2/13/85 Reorganized signal handling and made portable to 4.2bsd. +v13 2/16/85 Reword error message for '-' command. +v14 2/22/85 Added -bf and -bp variants of -b. +v15 2/25/85 Miscellaneous changes. +v16 3/13/85 Added -u flag for backspace processing. +v17 4/13/85 Added j and k commands, changed -t default. +v18 4/20/85 Rewrote signal handling code. +v19 5/2/85 Got rid of "verbose" eq_message(). + Made search() scroll in some cases. +v20 5/21/85 Fixed screen.c ioctls for System V. +v21 5/23/85 Fixed some first_cmd bugs. +v22 5/24/85 Added support for no RECOMP nor REGCMP. +v23 5/25/85 Miscellanous changes and prettying up. + Posted to USENET. +----------------------------------------------------------------- +v24 6/3/85 Added ti,te terminal init & de-init. + (Thanks to Mike Kersenbrock) +v25 6/8/85 Added -U flag, standout mode underlining. +v26 6/9/85 Added -M flag. + Use underline termcap (us) if it exists. +v27 6/15/85 Renamed some variables to make unique in + 6 chars. Minor fix to -m. +v28 6/28/85 Fixed right margin bug. +v29 6/28/85 Incorporated M.Rose's changes to signal.c +v30 6/29/85 Fixed stupid bug in argument processing. +v31 7/15/85 Added -p flag, changed repaint algorithm. + Added kludge for magic cookie terminals. +v32 7/16/85 Added cat_file if output not a tty. +v33 7/23/85 Added -e flag and EDITOR. +v34 7/26/85 Added -s flag. +v35 7/27/85 Rewrote option handling; added option.c. +v36 7/29/85 Fixed -e flag to work if not last file. +v37 8/10/85 Added -x flag. +v38 8/19/85 Changed prompting; created prompt.c. +v39 8/24/85 (Not -p) does not initially clear screen. +v40 8/26/85 Added "skipping" indicator in forw(). + Posted to USENET. +----------------------------------------------------------------- +v41 9/17/85 ONLY_RETURN, control char commands, + faster search, other minor fixes. +v42 9/25/85 Added ++ command line syntax; + ch_fsize for pipes. +v43 10/15/85 Added -h flag, changed prim.c algorithms. +v44 10/16/85 Made END print in all cases of eof; + ignore SIGTTOU after receiv ing SIGTSTP. +v45 10/16/85 Never print backspaces unless -u. +v46 10/24/85 Backwards scroll in jump_loc. +v47 10/30/85 Fixed bug in edit(): *first_cmd==0 +v48 11/16/85 Use TIOCSETN instead of TIOCSETP. + Added marks (m and ' commands). + Posted to USENET. +----------------------------------------------------------------- +v49 1/9/86 Fixed bug: signal didn't clear mcc. +v50 1/15/86 Added ' (quote) to gomark. +v51 1/16/86 Added + cmd, fixed problem if first_cmd + fails, made g cmd sort of "work" on pipes + ev en if bof is no longer buffered. +v52 1/17/86 Made short files work better. +v53 1/20/86 Added -P option. +v54 1/20/86 Changed help to use HELPFILE. +v55 1/23/86 Messages work better if not tty output. +v56 1/24/86 Added -l option. +v57 1/31/86 Fixed -l to get confirmation before + ov erwriting an existing file. +v58 8/28/86 Added filename globbing. +v59 9/15/86 Fixed some bugs with very long filenames. +v60 9/26/86 Incorporated changes from Leith (Casey) + Leedom for boldface and -z option. +v61 9/26/86 Got rid of annoying repaints after ! cmd. + Posted to USENET. +----------------------------------------------------------------- +v62 12/23/86 Added is_directory(); change -z default to + -1 instead of 24; cat-and-exit if -e and + file is less than a screenful. +v63 1/8/87 Fixed bug in cat-and-exit if > 1 file. +v64 1/12/87 Changed puts/putstr, putc/putchr, + getc/getchr to av oid name conflict with + stdio functions. +v65 1/26/87 Allowed '-' command to change NUMBER + v alued options (thanks to Gary Puckering) +v66 2/13/87 Fixed bug: prepaint should use force=1. +v67 2/24/87 Added !! and % expansion to ! command. +v68 2/25/87 Added SIGWINCH and TIOCGWINSZ support; + changed is_directory to bad_file. + (thanks to J. Robert Ward) +v69 2/25/87 Added SIGWIND and WIOCGETD (for Unix PC). +v70 3/13/87 Changed help cmd from 'h' to 'H'; better + error msgs in bad_file, errno_message. +v71 5/11/87 Changed -p to -c, made triple -c/-C + for clear-eol like more's -c. +v72 6/26/87 Added -E, -L, use $SHELL in lsystem(). + (thanks to Stev e Spearman) +v73 6/26/87 Allow Examine "#" for previous file. + Posted to USENET 8/25/87. +----------------------------------------------------------------- +v74 9/18/87 Fix conflict in EOF symbol with stdio.h, + Make os.c more portable to BSD. +v75 9/23/87 Fix problems in get_term (thanks to + Paul Eggert); new backwards scrolling in + jump_loc (thanks to Marion Hakanson). +v76 9/23/87 Added -i flag; allow single "!" to + inv oke a shell (thanks to Franco Barber). +v77 9/24/87 Added -n flag and line number support. +v78 9/25/87 Fixed problem with prompts longer than + the screen width. +v79 9/29/87 Added the _ command. +v80 10/6/87 Allow signal to break out of linenum scan. +v81 10/6/87 Allow -b to be changed from within less. +v82 10/7/87 Add cmd_decode to use a table for key + binding (thanks to Dav id Nason). +v83 10/9/87 Allow .less file for user-defined keys. +v84 10/11/87 Fix -e/-E problems (thanks to Felix Lee). +v85 10/15/87 Search now keeps track of line numbers. +v86 10/20/87 Added -B option and autobuf; fixed + "pipe error" bug. +v87 3/1/88 Fix bug re BSD signals while reading file. +v88 3/12/88 Use new format for -P option (thanks to + der Mouse), allow "+-c" without message, + fix bug re BSD hangup. +v89 3/18/88 Turn off line numbers if linenum scan + is interrupted. +v90 3/30/88 Allow -P from within less. +v91 3/30/88 Added tags file support (new -t option) + (thanks to Brian Campbell). +v92 4/4/88 Added -+option syntax. +v93 4/11/88 Add support for slow input (thanks to + Joe Orost & apologies for taking almost + 3 years to get this in!) +v94 4/11/88 Redo reading/signal stuff. +v95 4/20/88 Repaint screen better after signal. +v96 4/21/88 Add /! and ?! commands. +v97 5/17/88 Allow -l/-L from within less. + Eliminate some static arrays (use calloc). + Posted to USENET. +----------------------------------------------------------------- +v98 10/14/88 Fix incorrect calloc call; uninitialized + var in exec_mca; core dump on unknown TERM. + Make v cmd work if past last line of file. + Fix some signal bugs. +v99 10/29/88 Allow space between -X and string, + when X is a string-valued option. +v100 1/5/89 Fix globbing bug when $SHELL not set; + allow spaces after -t command. +v101 1/6/89 Fix problem with long (truncated) lines + in tags file (thanks to Neil Dixon). +v102 1/6/89 Fix bug with E# when no prev file; + allow spaces after -l command. +v103 3/14/89 Add -N, -f and -? options. Add z and w + commands. Add %L for prompt strings. +v104 3/16/89 Added EDITPROTO. +v105 3/20/89 Fix bug in find_linenum which cached + incorrectly on long lines. +v106 3/31/89 Added -k option and multiple lesskey + files. +v107 4/27/89 Add 8-bit char support and -g option. + Split option code into 3 files. +v108 5/5/89 Allocate position table dynamically + (thanks to Paul Eggert); change % command + from "percent" to vi-style brace finder. +v109 5/10/89 Added ESC-% command, split prim.c. +v110 5/24/89 Fixed bug in + option; fixed repaint bug + under Sun windows (thanks to Paul Eggert). +v111 5/25/89 Generalized # and % expansion; use + calloc for some error messages. +v112 5/30/89 Get rid of ESC-%, add {}()[] commands. +v113 5/31/89 Optimize lseeks (thanks to Paul Eggert). +v114 7/25/89 Added ESC-/ and ESC-/! commands. +v115 7/26/89 Added ESC-n command. +v116 7/31/89 Added find_pos to optimize g command. +v117 8/1/89 Change -f option to -r. +v118 8/2/89 Save positions for all previous files, + not just the immediately previous one. +v119 8/7/89 Save marks across file boundaries. + Add file handle stuff. +v120 8/11/89 Add :ta command. +v121 8/16/89 Add -f option. +v122 8/30/89 Fix performance with many buffers. +v123 8/31/89 Verbose prompts for string options. + Posted beta to USENET. +----------------------------------------------------------------- +v124 9/18/89 Reorganize search commands, + N = rev, ESC-n = span, add ESC-N. +v125 9/18/89 Fix tab bug (thanks to Alex Liu). + Fix EOF bug when both -w and -c. +v126 10/25/89 Add -j option. +v127 10/27/89 Fix problems with blank lines before BOF. +v128 10/27/89 Add %bj, etc. to prompt strings. +v129 11/3/89 Add -+,-- commands; add set-option and + unset-option to lesskey. +v130 11/6/89 Generalize A_EXTRA to string, remove + set-option, unset-option from lesskey. +v131 11/7/89 Changed name of EDITPROTO to LESSEDIT. +v132 11/8/89 Allow editing of command prefix. +v133 11/16/89 Add -y option (thanks to Jeff Sullivan). +v134 12/1/89 Glob filenames in the -l command. +v135 12/5/89 Combined {}()[] commands into one, and + added ESC-^F and ESC-^B commands. +v136 1/20/90 Added -S, -R flags. Added | command. + Added warning for binary files. (thanks + to Richard Brittain and J. Sullivan). +v137 1/21/90 Rewrote horrible pappend code. + Added * notation for hi-bit chars. +v138 1/24/90 Fix magic cookie terminal handling. + Get rid of "cleanup" loop in ch_get. +v139 1/27/90 Added MSDOS support. (many thanks + to Richard Brittain). +v140 2/7/90 Editing a new file adds it to the + command line list. +v141 2/8/90 Add edit_list for editing >1 file. +v142 2/10/90 Add :x command. +v143 2/11/90 Add * and @ modifies to search cmds. + Change ESC-/ cmd from /@* to / *. +v144 3/1/90 Messed around with ch_zero; + no real change. +v145 3/2/90 Added -R and -v/-V for MSDOS; + renamed FILENAME to avoid conflict. +v146 3/5/90 Pull cmdbuf functions out of command.c +v147 3/7/90 Implement ?@; fix multi-file edit bugs. +v148 3/29/90 Fixed bug in :e then :e#. +v149 4/3/90 Change error,ierror,query to use PARG. +v150 4/6/90 Add LESS_CHARSET, LESS_CHARDEF. +v151 4/13/90 Remove -g option; clean up ispipe. +v152 4/14/90 lsystem() closes input file, for + editors which require exclusive open. +v153 4/18/90 Fix bug if SHELL unset; + fix bug in overstrike control char. +v154 4/25/90 Output to fd 2 via buffer. +v155 4/30/90 Ignore -i if uppercase in pattern + (thanks to Michael Rendell.) +v156 5/3/90 Remove scroll limits in forw() & back(); + causes problems with -c. +v157 5/4/90 Forward search starts at next real line + (not screen line) after jump target. +v158 6/14/90 Added F command. +v159 7/29/90 Fix bug in exiting: output not flushed. +v160 7/29/90 Clear screen before initial output w/ -c. +v161 7/29/90 Add -T flag. +v162 8/14/90 Fix bug with +F on command line. +v163 8/21/90 Added LESSBINFMT variable. +v164 9/5/90 Added -p, LINES, COLUMNS and + unset mark ' == BOF, for 1003.2 D5. +v165 9/6/90 At EOF with -c set, don't display empty + screen when try to page forward. +v166 9/6/90 Fix G when final line in file wraps. +v167 9/11/90 Translate CR/LF -> LF for 1003.2. +v168 9/13/90 Return to curr file if "tag not found". +v169 12/12/90 G goes to EOF even if file has grown. +v170 1/17/91 Add optimization for BSD _setjmp; + fix #include ioctl.h TERMIO problem. + (thanks to Paul Eggert) + Posted to USENET. +----------------------------------------------------------------- +v171 3/6/91 Fix -? bug in get_filename. +v172 3/15/91 Fix G bug in empty file. + Fix bug with ?\n and -i and uppercase + pattern at EOF! + (thanks to Paul Eggert) +v173 3/17/91 Change N cmd to not permanently change + direction. (thanks to Brian Matthews) +v174 3/18/91 Fix bug with namelogfile not getting + cleared when change files. +v175 3/18/91 Fix bug with ++cmd on command line. + (thanks to Jim Meyering) +v176 4/2/91 Change | to not force current screen, + include marked line, start/end from + top of screen. Improve search speed. + (thanks to Don Mears) +v177 4/2/91 Add LESSHELP variable. + Fix bug with F command with -e. + Try /dev/tty for input before using fd 2. + Patches posted to USENET 4/2/91. +----------------------------------------------------------------- +v178 4/8/91 Fixed bug in globbing logfile name. + (thanks to Jim Meyering) +v179 4/9/91 Allow negative -z for screen-relative. +v180 4/9/91 Clear to eos rather than eol if "db"; + don't use "sr" if "da". + (thanks to Tor Lillqvist) +v181 4/18/91 Fixed bug with "negative" chars 80 - FF. + (thanks to Benny Sander Hofmann) +v182 5/16/91 Fixed bug with attribute at EOL. + (thanks to Brian Matthews) +v183 6/1/91 Rewrite linstall to do smart config. +v184 7/11/91 Process \b in searches based on -u + rather than -i. +v185 7/11/91 -Pxxx sets short prompt; assume SIGWINCH + after a SIGSTOP. (thanks to Ken Laprade) +----------------------------------------------------------------- +v186 4/20/92 Port to MS-DOS (Microsoft C). +v187 4/23/92 Added -D option & TAB_COMPLETE_FILENAME. +v188 4/28/92 Added command line editing features. +v189 12/8/92 Fix mem overrun in anscreen.c:init; + fix edit_list to recover from bin file. +v190 2/13/93 Make TAB enter one filename at a time; + create ^L with old TAB functionality. +v191 3/10/93 Defer creating "flash" page for MS-DOS. +v192 9/6/93 Add BACK-TAB. +v193 9/17/93 Simplify binary_file handling. +v194 1/4/94 Add rudiments of alt_filename handling. +v195 1/11/94 Port back to Unix; support keypad. +----------------------------------------------------------------- +v196 6/7/94 Fix bug with bad filename; fix IFILE + type problem. (thanks to David MacKenzie) +v197 6/7/94 Fix bug with .less tables inserted wrong. +v198 6/23/94 Use autoconf installation technology. + (thanks to David MacKenzie) +v199 6/29/94 Fix MS-DOS build (thanks to Tim Wiegman). +v200 7/25/94 Clean up copyright, minor fixes. + Posted to prep.ai.mit.edu +----------------------------------------------------------------- +v201 7/27/94 Check for no memcpy; add casts to calloc; + look for regcmp in libgen.a. + (thanks to Kaveh Ghazi). +v202 7/28/94 Fix bug in edit_next/edit_prev with + non-existant files. +v203 8/2/94 Fix a variety of configuration bugs on + various systems. (thanks to Sakai + Kiyotaka, Harald Koenig, Bjorn Brox, + Teemu Rantanen, and Thorsten Lockert) +v204 8/3/94 Use strerror if available. + (thanks to J.T. Conklin) +v205 8/5/94 Fix bug in finding "me" termcap entry. + (thanks to Andreas Stolcke) +8/10/94 v205+: Change BUFSIZ to LBUFSIZE to avoid name + conflict with stdio.h. + Posted to prep.ai.mit.edu +----------------------------------------------------------------- +v206 8/10/94 Use initial_scrpos for -t to avoid + displaying first page before init(). + (thanks to Dominique Petitpierre) +v207 8/12/94 Fix bug if stdout is not tty. +v208 8/16/94 Fix bug in close_altfile if goto err1 + in edit_ifile. (Thanks to M.J. Hewitt) +v209 8/16/94 Change scroll to wscroll to avoid + conflict with library function. +v210 8/16/94 Fix bug with bold on 8 bit chars. + (thanks to Vitor Duarte) +v211 8/16/94 Don't quit on EOI in jump_loc / forw. +v212 8/18/94 Use time_t if available. +v213 8/20/94 Allow ospeed to be defined in termcap.h. +v214 8/20/94 Added HILITE_SEARCH, -F, ESC-u cmd. + (thanks to Paul Lew and Bob Byrnes) +v215 8/23/94 Fix -i toggle behavior. +v216 8/23/94 Process BS in all searches, not only -u. +v217 8/24/94 Added -X flag. +v218 8/24/94 Reimplement undo_search. +v219 8/24/94 Find tags marked with line number + instead of pattern. +v220 8/24/94 Stay at same position after SIG_WINCH. +v221 8/24/94 Fix bug in file percentage in big file. +v222 8/25/94 Do better if can't reopen current file. +v223 8/27/94 Support setlocale. + (thanks to Robert Joop) +v224 8/29/94 Revert v216: process BS in search + only if -u. +v225 9/6/94 Rewrite undo_search again: toggle. +v226 9/15/94 Configuration fixes. + (thanks to David MacKenzie) +v227 9/19/94 Fixed strerror config problem. + Posted to prep.ai.mit.edu +----------------------------------------------------------------- +v228 9/21/94 Fix bug in signals: repeated calls to + get_editkeys overflowed st_edittable. +v229 9/21/94 Fix "Nothing to search" error if -a + and SRCH_PAST_EOF. +v230 9/21/94 Don't print extra error msg in search + after regerror(). +v231 9/22/94 Fix hilite bug if search matches 0 chars. + (thanks to John Polstra) +v232 9/23/94 Deal with weird systems that have + termios.h but not tcgetattr(). + Posted to prep.ai.mit.edu +----------------------------------------------------------------- +v233 9/26/94 Use get_term() instead of pos_init() in + psignals to re-get lower_left termcap. + (Thanks to John Malecki) +v234 9/26/94 Make MIDDLE closer to middle of screen. +v235 9/27/94 Use local strchr if system doesn't have. +v236 9/28/94 Don't use libucb; use libterm if + libtermcap & libcurses doesn't work. + (Fix for Solaris; thanks to Frank Kaefer) +v237 9/30/94 Use system isupper() etc if provided. + Posted to prep.ai.mit.edu +----------------------------------------------------------------- +v238 10/6/94 Make binary non-blinking if LESSBINFMT + is set to a string without a *. +v239 10/7/94 Don't let delimit_word run back past + beginning of cmdbuf. +v240 10/10/94 Don't write into termcap buffer. + (Thanks to Benoit Speckel) +v241 10/13/94 New lesskey file format. + Don't expand filenames in search command. +v242 10/14/94 Allow lesskey specification of "literal". +v243 10/14/94 Add #stop command to lesskey. +v244 10/16/94 Add -f flag to lesskey. +v245 10/25/94 Allow TAB_COMPLETE_FILENAME to be undefd. +v246 10/27/94 Move help file to /usr/local/share. +v247 10/27/94 Add -V option. +v248 11/5/94 Add -V option to lesskey. +v249 11/5/94 Remove -f flag from lesskey; default + input file is ~/.lesskey.in, not stdin. +v250 11/7/94 Lesskey input file "-" means stdin. +v251 11/9/94 Convert cfgetospeed result to ospeed. + (Thanks to Andrew Chernov) +v252 11/16/94 Change default lesskey input file from + .lesskey.in to .lesskey. + Posted to prep.ai.mit.edu +----------------------------------------------------------------- +v253 11/21/94 Fix bug when tags file has a backslash. +v254 12/6/94 Fix -k option. +v255 12/8/94 Add #define EXAMINE to disable :e etc. +v256 12/10/94 Change highlighting: only highlite search + results (but now it is reliable). +v257 12/10/94 Add goto_line and repaint_highlight + to optimize highlight repaints. +v258 12/12/94 Fixup in hilite_line if BS_SPECIAL. +v259 12/12/94 Convert to autoconf 2.0. +v260 12/13/94 Add SECURE define. +v261 12/14/94 Use system WERASE char as EC_W_BACKSPACE. +v262 12/16/94 Add -g/-G flag and screen_hilite. +v263 12/20/94 Reimplement/optimize -G flag behavior. +v264 12/23/94 Allow EXTRA string after line-edit cmd + in lesskey file. +v265 12/24/94 Add LESSOPEN=|cmd syntax. +v266 12/26/94 Add -I flag. +v267 12/28/94 Formalize the four-byte header emitted + by a LESSOPEN pipe. +v268 12/28/94 Get rid of four-byte header. +v269 1/2/95 Close alt file before open new one. + Avoids multiple popen(). +v270 1/3/95 Use VISUAL; use S_ISDIR/S_ISREG; fix + config problem with Solaris POSIX regcomp. +v271 1/4/95 Don't quit on read error. +v272 1/5/95 Get rid of -L. +v273 1/6/95 Fix ch_ungetchar bug; don't call + LESSOPEN on a pipe. +v274 1/6/95 Ported to OS/2 (thanks to Kai Uwe Rommel) +v275 1/18/95 Fix bug if toggle -G at EOF. +v276 1/30/95 Fix OS/2 version. +v277 1/31/95 Add "next" charset; don't display ^X + for X > 128. +v278 2/14/95 Change default for -G. + Posted to prep.ai.mit.edu +----------------------------------------------------------------- +v279 2/22/95 Add GNU options --help, --version. + Minor config fixes. +v280 2/24/95 Clean up calls to glob(); don't set # + if we can't open the new file. +v281 2/24/95 Repeat search should turn on hilites. +v282 3/2/95 Minor fixes. +v283 3/2/95 Fix homefile; make OS2 look in $HOME. +v284 3/2/95 Error if "v" on LESSOPENed file; + "%" figures out file size on pipe. +v285 3/7/95 Don't set # in lsystem; + lesskey try $HOME first. +v286 3/7/95 Reformat change history (too much free time?). +v287 3/8/95 Fix hilite bug if overstrike multiple chars. +v288 3/8/95 Allow lesskey to override get_editkey keys. +v289 3/9/95 Fix adj_hilite bug when line gets processed by + hilite_line more than once. +v290 3/9/95 Make configure automatically. Fix Sequent problem + with incompatible sigsetmask(). + +*/ + +char version[] = "290";