version.c revision 128345
160786Sps/*
2128345Stjr * Copyright (C) 1984-2002  Mark Nudelman
360786Sps *
460786Sps * You may distribute under the terms of either the GNU General Public
560786Sps * License or the Less License, as specified in the README file.
660786Sps *
760786Sps * For more information about less, or for information on how to
860786Sps * contact the author, see the README file.
960786Sps */
1060786Sps
1160786Sps
1260786Sps/*
1360786Sps----------------------- CHANGE HISTORY --------------------------
1460786Sps
1560786Sps       1/29/84	Allowed use on standard input
1660786Sps       2/1/84	Added E, N, P commands
1760786Sps       4/17/84	Added '=' command, 'stop' signal handling
1860786Sps       4/20/84	Added line folding
1960786Spsv2     4/27/84	Fixed '=' command to use BOTTOM_PLUS_ONE,
2060786Sps		instead of TOP, added 'p' & 'v' commands
2160786Spsv3     5/3/84	Added -m and -t options, '-' command
2260786Spsv4     5/3/84	Added LESS environment variable
2360786Spsv5     5/3/84	New comments, fixed '-' command slightly
2460786Spsv6     5/15/84	Added -Q, visual bell
2560786Spsv7     5/24/84	Fixed jump_back(n) bug: n should count real
2660786Sps		lines, not folded lines.  Also allow number on G command.
2760786Spsv8     5/30/84	Re-do -q and -Q commands
2860786Spsv9     9/25/84	Added "+<cmd>" argument
2960786Spsv10    10/10/84	Fixed bug in -b<n> argument processing
3060786Spsv11    10/18/84	Made error() ring bell if \n not entered.
3160786Sps-----------------------------------------------------------------
3260786Spsv12    2/13/85	Reorganized signal handling and made portable to 4.2bsd.
3360786Spsv13    2/16/85	Reword error message for '-' command.
3460786Spsv14    2/22/85	Added -bf and -bp variants of -b.
3560786Spsv15    2/25/85	Miscellaneous changes.
3660786Spsv16    3/13/85	Added -u flag for backspace processing.
3760786Spsv17    4/13/85	Added j and k commands, changed -t default.
3860786Spsv18    4/20/85	Rewrote signal handling code.
3960786Spsv19    5/2/85	Got rid of "verbose" eq_message().
4060786Sps		Made search() scroll in some cases.
4160786Spsv20    5/21/85	Fixed screen.c ioctls for System V.
4260786Spsv21    5/23/85	Fixed some first_cmd bugs.
4360786Spsv22    5/24/85	Added support for no RECOMP nor REGCMP.
4460786Spsv23    5/25/85	Miscellanous changes and prettying up.
4560786Sps		Posted to USENET.
4660786Sps-----------------------------------------------------------------
4760786Spsv24    6/3/85	Added ti,te terminal init & de-init.
4860786Sps		(Thanks to Mike Kersenbrock)
4960786Spsv25    6/8/85	Added -U flag, standout mode underlining.
5060786Spsv26    6/9/85	Added -M flag.
5160786Sps		Use underline termcap (us) if it exists.
5260786Spsv27    6/15/85	Renamed some variables to make unique in
5360786Sps		6 chars.  Minor fix to -m.
5460786Spsv28    6/28/85	Fixed right margin bug.
5560786Spsv29    6/28/85	Incorporated M.Rose's changes to signal.c
5660786Spsv30    6/29/85	Fixed stupid bug in argument processing.
5760786Spsv31    7/15/85	Added -p flag, changed repaint algorithm.
5860786Sps		Added kludge for magic cookie terminals.
5960786Spsv32    7/16/85	Added cat_file if output not a tty.
6060786Spsv33    7/23/85	Added -e flag and EDITOR.
6160786Spsv34    7/26/85	Added -s flag.
6260786Spsv35    7/27/85	Rewrote option handling; added option.c.
6360786Spsv36    7/29/85	Fixed -e flag to work if not last file.
6460786Spsv37    8/10/85	Added -x flag.
6560786Spsv38    8/19/85	Changed prompting; created prompt.c.
6660786Spsv39    8/24/85	(Not -p) does not initially clear screen.
6760786Spsv40    8/26/85	Added "skipping" indicator in forw().
6860786Sps		Posted to USENET.
6960786Sps-----------------------------------------------------------------
7060786Spsv41    9/17/85	ONLY_RETURN, control char commands,
7160786Sps		faster search, other minor fixes.
7260786Spsv42    9/25/85	Added ++ command line syntax;
7360786Sps		ch_fsize for pipes.
7460786Spsv43    10/15/85	Added -h flag, changed prim.c algorithms.
7560786Spsv44    10/16/85	Made END print in all cases of eof;
7660786Sps		ignore SIGTTOU after receiv ing SIGTSTP.
7760786Spsv45    10/16/85	Never print backspaces unless -u.
7860786Spsv46    10/24/85	Backwards scroll in jump_loc.
7960786Spsv47    10/30/85	Fixed bug in edit(): *first_cmd==0
8060786Spsv48    11/16/85	Use TIOCSETN instead of TIOCSETP.
8160786Sps		Added marks (m and ' commands).
8260786Sps		Posted to USENET.
8360786Sps-----------------------------------------------------------------
8460786Spsv49    1/9/86	Fixed bug: signal didn't clear mcc.
8560786Spsv50    1/15/86	Added ' (quote) to gomark.
8660786Spsv51    1/16/86	Added + cmd, fixed problem if first_cmd
8760786Sps		fails, made g cmd sort of "work" on pipes
8860786Sps		ev en if bof is no longer buffered.
8960786Spsv52    1/17/86	Made short files work better.
9060786Spsv53    1/20/86	Added -P option.
9160786Spsv54    1/20/86	Changed help to use HELPFILE.
9260786Spsv55    1/23/86	Messages work better if not tty output.
9360786Spsv56    1/24/86	Added -l option.
9460786Spsv57    1/31/86	Fixed -l to get confirmation before
9560786Sps		ov erwriting an existing file.
9660786Spsv58    8/28/86	Added filename globbing.
9760786Spsv59    9/15/86	Fixed some bugs with very long filenames.
9860786Spsv60    9/26/86	Incorporated changes from Leith (Casey)
9960786Sps		Leedom for boldface and -z option.
10060786Spsv61    9/26/86	Got rid of annoying repaints after ! cmd.
10160786Sps		Posted to USENET.
10260786Sps-----------------------------------------------------------------
10360786Spsv62    12/23/86	Added is_directory(); change -z default to
10460786Sps		-1 instead of 24; cat-and-exit if -e and
10560786Sps		file is less than a screenful.
10660786Spsv63    1/8/87	Fixed bug in cat-and-exit if > 1 file.
10760786Spsv64    1/12/87	Changed puts/putstr, putc/putchr,
10860786Sps		getc/getchr to av oid name conflict with
10960786Sps		stdio functions.
11060786Spsv65    1/26/87	Allowed '-' command to change NUMBER
11160786Sps		v alued options (thanks to Gary Puckering)
11260786Spsv66    2/13/87	Fixed bug: prepaint should use force=1.
11360786Spsv67    2/24/87	Added !! and % expansion to ! command.
11460786Spsv68    2/25/87	Added SIGWINCH and TIOCGWINSZ support;
11560786Sps		changed is_directory to bad_file.
11660786Sps		(thanks to J. Robert Ward)
11760786Spsv69    2/25/87	Added SIGWIND and WIOCGETD (for Unix PC).
11860786Spsv70    3/13/87	Changed help cmd from 'h' to 'H'; better
11960786Sps		error msgs in bad_file, errno_message.
12060786Spsv71    5/11/87	Changed -p to -c, made triple -c/-C
12160786Sps		for clear-eol like more's -c.
12260786Spsv72    6/26/87	Added -E, -L, use $SHELL in lsystem().
12360786Sps		(thanks to Stev e Spearman)
12460786Spsv73    6/26/87	Allow Examine "#" for previous file.
12560786Sps		Posted to USENET 8/25/87.
12660786Sps-----------------------------------------------------------------
12760786Spsv74    9/18/87	Fix conflict in EOF symbol with stdio.h,
12860786Sps		Make os.c more portable to BSD.
12960786Spsv75    9/23/87	Fix problems in get_term (thanks to
13060786Sps		Paul Eggert); new backwards scrolling in
13160786Sps		jump_loc (thanks to Marion Hakanson).
13260786Spsv76    9/23/87	Added -i flag; allow single "!" to
13360786Sps		inv oke a shell (thanks to Franco Barber).
13460786Spsv77    9/24/87	Added -n flag and line number support.
13560786Spsv78    9/25/87	Fixed problem with prompts longer than
13660786Sps		the screen width.
13760786Spsv79    9/29/87	Added the _ command.
13860786Spsv80    10/6/87	Allow signal to break out of linenum scan.
13960786Spsv81    10/6/87	Allow -b to be changed from within less.
14060786Spsv82    10/7/87	Add cmd_decode to use a table for key
14160786Sps		binding (thanks to Dav id Nason).
14260786Spsv83    10/9/87	Allow .less file for user-defined keys.
14360786Spsv84    10/11/87	Fix -e/-E problems (thanks to Felix Lee).
14460786Spsv85    10/15/87	Search now keeps track of line numbers.
14560786Spsv86    10/20/87	Added -B option and autobuf; fixed
14660786Sps		"pipe error" bug.
14760786Spsv87    3/1/88	Fix bug re BSD signals while reading file.
14860786Spsv88    3/12/88	Use new format for -P option (thanks to
14960786Sps		der Mouse), allow "+-c" without message,
15060786Sps		fix bug re BSD hangup.
15160786Spsv89    3/18/88	Turn off line numbers if linenum scan
15260786Sps		is interrupted.
15360786Spsv90    3/30/88	Allow -P from within less.
15460786Spsv91    3/30/88	Added tags file support (new -t option)
15560786Sps		(thanks to Brian Campbell).
15660786Spsv92    4/4/88	Added -+option syntax.
15760786Spsv93    4/11/88	Add support for slow input (thanks to
15860786Sps		Joe Orost & apologies for taking almost
15960786Sps		3 years to get this in!)
16060786Spsv94    4/11/88	Redo reading/signal stuff.
16160786Spsv95    4/20/88	Repaint screen better after signal.
16260786Spsv96    4/21/88	Add /! and ?! commands.
16360786Spsv97    5/17/88	Allow -l/-L from within less.
16460786Sps		Eliminate some static arrays (use calloc).
16560786Sps		Posted to USENET.
16660786Sps-----------------------------------------------------------------
16760786Spsv98    10/14/88	Fix incorrect calloc call; uninitialized
16860786Sps		var in exec_mca; core dump on unknown TERM.
16960786Sps		Make v cmd work if past last line of file.
17060786Sps		Fix some signal bugs.
17160786Spsv99    10/29/88	Allow space between -X and string,
17260786Sps		when X is a string-valued option.
17360786Spsv100   1/5/89	Fix globbing bug when $SHELL not set;
17460786Sps		allow spaces after -t command.
17560786Spsv101   1/6/89	Fix problem with long (truncated) lines
17660786Sps		in tags file (thanks to Neil Dixon).
17760786Spsv102   1/6/89	Fix bug with E# when no prev file;
17860786Sps		allow spaces after -l command.
17960786Spsv103   3/14/89	Add -N, -f and -? options.  Add z and w
18060786Sps		commands.  Add %L for prompt strings.
18160786Spsv104   3/16/89	Added EDITPROTO.
18260786Spsv105   3/20/89	Fix bug in find_linenum which cached
18360786Sps		incorrectly on long lines.
18460786Spsv106   3/31/89	Added -k option and multiple lesskey
18560786Sps		files.
18660786Spsv107   4/27/89	Add 8-bit char support and -g option.
18760786Sps		Split option code into 3 files.
18860786Spsv108   5/5/89	Allocate position table dynamically
18960786Sps		(thanks to Paul Eggert); change % command
19060786Sps		from "percent" to vi-style brace finder.
19160786Spsv109   5/10/89	Added ESC-% command, split prim.c.
19260786Spsv110   5/24/89	Fixed bug in + option; fixed repaint bug
19360786Sps		under Sun windows (thanks to Paul Eggert).
19460786Spsv111   5/25/89	Generalized # and % expansion; use
19560786Sps		calloc for some error messages.
19660786Spsv112   5/30/89	Get rid of ESC-%, add {}()[] commands.
19760786Spsv113   5/31/89	Optimize lseeks (thanks to Paul Eggert).
19860786Spsv114   7/25/89	Added ESC-/ and ESC-/! commands.
19960786Spsv115   7/26/89	Added ESC-n command.
20060786Spsv116   7/31/89	Added find_pos to optimize g command.
20160786Spsv117   8/1/89	Change -f option to -r.
20260786Spsv118   8/2/89	Save positions for all previous files,
20360786Sps		not just the immediately previous one.
20460786Spsv119   8/7/89	Save marks across file boundaries.
20560786Sps		Add file handle stuff.
20660786Spsv120   8/11/89	Add :ta command.
20760786Spsv121   8/16/89	Add -f option.
20860786Spsv122   8/30/89	Fix performance with many buffers.
20960786Spsv123   8/31/89	Verbose prompts for string options.
21060786Sps		Posted beta to USENET.
21160786Sps-----------------------------------------------------------------
21260786Spsv124   9/18/89	Reorganize search commands,
21360786Sps		N = rev, ESC-n = span, add ESC-N.
21460786Spsv125   9/18/89	Fix tab bug (thanks to Alex Liu).
21560786Sps		Fix EOF bug when both -w and -c.
21660786Spsv126   10/25/89	Add -j option.
21760786Spsv127   10/27/89	Fix problems with blank lines before BOF.
21860786Spsv128   10/27/89	Add %bj, etc. to prompt strings.
21960786Spsv129   11/3/89	Add -+,-- commands; add set-option and
22060786Sps		unset-option to lesskey.
22160786Spsv130   11/6/89	Generalize A_EXTRA to string, remove
22260786Sps		set-option, unset-option from lesskey.
22360786Spsv131   11/7/89	Changed name of EDITPROTO to LESSEDIT.
22460786Spsv132   11/8/89	Allow editing of command prefix.
22560786Spsv133   11/16/89	Add -y option (thanks to Jeff Sullivan).
22660786Spsv134   12/1/89	Glob filenames in the -l command.
22760786Spsv135   12/5/89	Combined {}()[] commands into one, and
22860786Sps		added ESC-^F and ESC-^B commands.
22960786Spsv136   1/20/90	Added -S, -R flags.  Added | command.
23060786Sps		Added warning for binary files. (thanks
23160786Sps		to Richard Brittain and J. Sullivan).
23260786Spsv137   1/21/90	Rewrote horrible pappend code.
23360786Sps		Added * notation for hi-bit chars.
23460786Spsv138   1/24/90	Fix magic cookie terminal handling.
23560786Sps		Get rid of "cleanup" loop in ch_get.
23660786Spsv139   1/27/90	Added MSDOS support.  (many thanks
23760786Sps		to Richard Brittain).
23860786Spsv140   2/7/90	Editing a new file adds it to the
23960786Sps		command line list.
24060786Spsv141   2/8/90	Add edit_list for editing >1 file.
24160786Spsv142   2/10/90	Add :x command.
24260786Spsv143   2/11/90	Add * and @ modifies to search cmds.
24360786Sps		Change ESC-/ cmd from /@* to / *.
24460786Spsv144   3/1/90	Messed around with ch_zero;
24560786Sps		no real change.
24660786Spsv145   3/2/90	Added -R and -v/-V for MSDOS;
24760786Sps		renamed FILENAME to avoid conflict.
24860786Spsv146   3/5/90	Pull cmdbuf functions out of command.c
24960786Spsv147   3/7/90	Implement ?@; fix multi-file edit bugs.
25060786Spsv148   3/29/90	Fixed bug in :e<file> then :e#.
25160786Spsv149   4/3/90	Change error,ierror,query to use PARG.
25260786Spsv150   4/6/90	Add LESS_CHARSET, LESS_CHARDEF.
25360786Spsv151   4/13/90	Remove -g option; clean up ispipe.
25460786Spsv152   4/14/90	lsystem() closes input file, for
25560786Sps		editors which require exclusive open.
25660786Spsv153   4/18/90	Fix bug if SHELL unset;
25760786Sps		fix bug in overstrike control char.
25860786Spsv154   4/25/90	Output to fd 2 via buffer.
25960786Spsv155   4/30/90	Ignore -i if uppercase in pattern
26060786Sps		(thanks to Michael Rendell.)
26160786Spsv156   5/3/90	Remove scroll limits in forw() & back();
26260786Sps		causes problems with -c.
26360786Spsv157   5/4/90	Forward search starts at next real line
26460786Sps		(not screen line) after jump target.
26560786Spsv158   6/14/90	Added F command.
26660786Spsv159   7/29/90	Fix bug in exiting: output not flushed.
26760786Spsv160   7/29/90	Clear screen before initial output w/ -c.
26860786Spsv161   7/29/90	Add -T flag.
26960786Spsv162   8/14/90	Fix bug with +F on command line.
27060786Spsv163   8/21/90	Added LESSBINFMT variable.
27160786Spsv164   9/5/90	Added -p, LINES, COLUMNS and
27260786Sps		unset mark ' == BOF, for 1003.2 D5.
27360786Spsv165   9/6/90	At EOF with -c set, don't display empty
27460786Sps		screen when try to page forward.
27560786Spsv166   9/6/90	Fix G when final line in file wraps.
27660786Spsv167   9/11/90	Translate CR/LF -> LF for 1003.2.
27760786Spsv168   9/13/90	Return to curr file if "tag not found".
27860786Spsv169   12/12/90	G goes to EOF even if file has grown.
27960786Spsv170   1/17/91	Add optimization for BSD _setjmp;
28060786Sps		fix #include ioctl.h TERMIO problem.
28160786Sps		(thanks to Paul Eggert)
28260786Sps		Posted to USENET.
28360786Sps-----------------------------------------------------------------
28460786Spsv171   3/6/91	Fix -? bug in get_filename.
28560786Spsv172   3/15/91	Fix G bug in empty file.
28660786Sps		Fix bug with ?\n and -i and uppercase
28760786Sps		pattern at EOF!
28860786Sps		(thanks to Paul Eggert)
28960786Spsv173   3/17/91	Change N cmd to not permanently change
29060786Sps		direction. (thanks to Brian Matthews)
29160786Spsv174   3/18/91	Fix bug with namelogfile not getting
29260786Sps		cleared when change files.
29360786Spsv175   3/18/91	Fix bug with ++cmd on command line.
29460786Sps		(thanks to Jim Meyering)
29560786Spsv176   4/2/91	Change | to not force current screen,
29660786Sps		include marked line, start/end from
29760786Sps		top of screen.  Improve search speed.
29860786Sps		(thanks to Don Mears)
29960786Spsv177   4/2/91	Add LESSHELP variable.
30060786Sps		Fix bug with F command with -e.
30160786Sps		Try /dev/tty for input before using fd 2.
30260786Sps		Patches posted to USENET  4/2/91.
30360786Sps-----------------------------------------------------------------
30460786Spsv178   4/8/91	Fixed bug in globbing logfile name.
30560786Sps		(thanks to Jim Meyering)
30660786Spsv179   4/9/91	Allow negative -z for screen-relative.
30760786Spsv180   4/9/91	Clear to eos rather than eol if "db";
30860786Sps		don't use "sr" if "da".
30960786Sps		(thanks to Tor Lillqvist)
31060786Spsv181   4/18/91	Fixed bug with "negative" chars 80 - FF.
31160786Sps		(thanks to Benny Sander Hofmann)
31260786Spsv182   5/16/91	Fixed bug with attribute at EOL.
31360786Sps		(thanks to Brian Matthews)
31460786Spsv183   6/1/91	Rewrite linstall to do smart config.
31560786Spsv184   7/11/91	Process \b in searches based on -u
31660786Sps		rather than -i.
31760786Spsv185   7/11/91	-Pxxx sets short prompt; assume SIGWINCH
31860786Sps		after a SIGSTOP. (thanks to Ken Laprade)
31960786Sps-----------------------------------------------------------------
32060786Spsv186   4/20/92	Port to MS-DOS (Microsoft C).
32160786Spsv187   4/23/92	Added -D option & TAB_COMPLETE_FILENAME.
32260786Spsv188   4/28/92	Added command line editing features.
32360786Spsv189   12/8/92	Fix mem overrun in anscreen.c:init;
32460786Sps		fix edit_list to recover from bin file.
32560786Spsv190   2/13/93	Make TAB enter one filename at a time;
32660786Sps		create ^L with old TAB functionality.
32760786Spsv191   3/10/93	Defer creating "flash" page for MS-DOS.
32860786Spsv192   9/6/93	Add BACK-TAB.
32960786Spsv193   9/17/93	Simplify binary_file handling.
33060786Spsv194   1/4/94	Add rudiments of alt_filename handling.
33160786Spsv195   1/11/94	Port back to Unix; support keypad.
33260786Sps-----------------------------------------------------------------
33360786Spsv196   6/7/94	Fix bug with bad filename; fix IFILE
33460786Sps		type problem. (thanks to David MacKenzie)
33560786Spsv197   6/7/94	Fix bug with .less tables inserted wrong.
33660786Spsv198   6/23/94	Use autoconf installation technology.
33760786Sps		(thanks to David MacKenzie)
33860786Spsv199   6/29/94	Fix MS-DOS build (thanks to Tim Wiegman).
33960786Spsv200   7/25/94	Clean up copyright, minor fixes.
34060786Sps	Posted to prep.ai.mit.edu
34160786Sps-----------------------------------------------------------------
34260786Spsv201   7/27/94	Check for no memcpy; add casts to calloc;
34360786Sps		look for regcmp in libgen.a.
34460786Sps		(thanks to Kaveh Ghazi).
34560786Spsv202   7/28/94	Fix bug in edit_next/edit_prev with
34660786Sps		non-existant files.
34760786Spsv203   8/2/94	Fix a variety of configuration bugs on
34860786Sps		various systems. (thanks to Sakai
34960786Sps		Kiyotaka, Harald Koenig, Bjorn Brox,
35060786Sps		Teemu Rantanen, and Thorsten Lockert)
35160786Spsv204   8/3/94	Use strerror if available.
35260786Sps		(thanks to J.T. Conklin)
35360786Spsv205   8/5/94	Fix bug in finding "me" termcap entry.
35460786Sps		(thanks to Andreas Stolcke)
35560786Sps8/10/94 	v205+: Change BUFSIZ to LBUFSIZE to avoid name
35660786Sps		conflict with stdio.h.
35760786Sps		Posted to prep.ai.mit.edu
35860786Sps-----------------------------------------------------------------
35960786Spsv206   8/10/94	Use initial_scrpos for -t to avoid
36060786Sps		displaying first page before init().
36160786Sps		(thanks to Dominique Petitpierre)
36260786Spsv207   8/12/94	Fix bug if stdout is not tty.
36360786Spsv208   8/16/94	Fix bug in close_altfile if goto err1
36460786Sps		in edit_ifile. (Thanks to M.J. Hewitt)
36560786Spsv209   8/16/94	Change scroll to wscroll to avoid
36660786Sps		conflict with library function.
36760786Spsv210   8/16/94	Fix bug with bold on 8 bit chars.
36860786Sps		(thanks to Vitor Duarte)
36960786Spsv211   8/16/94	Don't quit on EOI in jump_loc / forw.
37060786Spsv212   8/18/94	Use time_t if available.
37160786Spsv213   8/20/94	Allow ospeed to be defined in termcap.h.
37260786Spsv214   8/20/94	Added HILITE_SEARCH, -F, ESC-u cmd.
37360786Sps		(thanks to Paul Lew and Bob Byrnes)
37460786Spsv215   8/23/94	Fix -i toggle behavior.
37560786Spsv216   8/23/94	Process BS in all searches, not only -u.
37660786Spsv217   8/24/94	Added -X flag.
37760786Spsv218   8/24/94	Reimplement undo_search.
37860786Spsv219   8/24/94	Find tags marked with line number
37960786Sps		instead of pattern.
38060786Spsv220   8/24/94	Stay at same position after SIG_WINCH.
38160786Spsv221   8/24/94	Fix bug in file percentage in big file.
38260786Spsv222   8/25/94	Do better if can't reopen current file.
38360786Spsv223   8/27/94	Support setlocale.
38460786Sps		(thanks to Robert Joop)
38560786Spsv224   8/29/94	Revert v216: process BS in search
38660786Sps		only if -u.
38760786Spsv225   9/6/94	Rewrite undo_search again: toggle.
38860786Spsv226   9/15/94	Configuration fixes.
38960786Sps		(thanks to David MacKenzie)
39060786Spsv227   9/19/94	Fixed strerror config problem.
39160786Sps		Posted to prep.ai.mit.edu
39260786Sps-----------------------------------------------------------------
39360786Spsv228   9/21/94	Fix bug in signals: repeated calls to
39460786Sps		get_editkeys overflowed st_edittable.
39560786Spsv229   9/21/94	Fix "Nothing to search" error if -a
39660786Sps		and SRCH_PAST_EOF.
39760786Spsv230   9/21/94	Don't print extra error msg in search
39860786Sps		after regerror().
39960786Spsv231   9/22/94	Fix hilite bug if search matches 0 chars.
40060786Sps		(thanks to John Polstra)
40160786Spsv232   9/23/94	Deal with weird systems that have
40260786Sps		termios.h but not tcgetattr().
40360786Sps		Posted to prep.ai.mit.edu
40460786Sps-----------------------------------------------------------------
40560786Spsv233   9/26/94	Use get_term() instead of pos_init() in
40660786Sps		psignals to re-get lower_left termcap.
40760786Sps		(Thanks to John Malecki)
40860786Spsv234   9/26/94	Make MIDDLE closer to middle of screen.
40960786Spsv235   9/27/94	Use local strchr if system doesn't have.
41060786Spsv236   9/28/94	Don't use libucb; use libterm if
41160786Sps		libtermcap & libcurses doesn't work.
41260786Sps		(Fix for Solaris; thanks to Frank Kaefer)
41360786Spsv237   9/30/94	Use system isupper() etc if provided.
41460786Sps		Posted to prep.ai.mit.edu
41560786Sps-----------------------------------------------------------------
41660786Spsv238   10/6/94	Make binary non-blinking if LESSBINFMT
41760786Sps		is set to a string without a *.
41860786Spsv239   10/7/94	Don't let delimit_word run back past
41960786Sps		beginning of cmdbuf.
42060786Spsv240   10/10/94	Don't write into termcap buffer.
42160786Sps		(Thanks to Benoit Speckel)
42260786Spsv241   10/13/94	New lesskey file format.
42360786Sps		Don't expand filenames in search command.
42460786Spsv242   10/14/94	Allow lesskey specification of "literal".
42560786Spsv243   10/14/94	Add #stop command to lesskey.
42660786Spsv244   10/16/94	Add -f flag to lesskey.
42760786Spsv245   10/25/94	Allow TAB_COMPLETE_FILENAME to be undefd.
42860786Spsv246   10/27/94	Move help file to /usr/local/share.
42960786Spsv247   10/27/94	Add -V option.
43060786Spsv248   11/5/94	Add -V option to lesskey.
43160786Spsv249   11/5/94	Remove -f flag from lesskey; default
43260786Sps		input file is ~/.lesskey.in, not stdin.
43360786Spsv250   11/7/94	Lesskey input file "-" means stdin.
43460786Spsv251   11/9/94	Convert cfgetospeed result to ospeed.
43560786Sps		(Thanks to Andrew Chernov)
43660786Spsv252   11/16/94	Change default lesskey input file from
43760786Sps		.lesskey.in to .lesskey.
43860786Sps		Posted to prep.ai.mit.edu
43960786Sps-----------------------------------------------------------------
44060786Spsv253   11/21/94	Fix bug when tags file has a backslash.
44160786Spsv254   12/6/94	Fix -k option.
44260786Spsv255   12/8/94	Add #define EXAMINE to disable :e etc.
44360786Spsv256   12/10/94	Change highlighting: only highlite search
44460786Sps		results (but now it is reliable).
44560786Spsv257   12/10/94	Add goto_line and repaint_highlight
44660786Sps		to optimize highlight repaints.
44760786Spsv258   12/12/94	Fixup in hilite_line if BS_SPECIAL.
44860786Spsv259   12/12/94	Convert to autoconf 2.0.
44960786Spsv260   12/13/94	Add SECURE define.
45060786Spsv261   12/14/94	Use system WERASE char as EC_W_BACKSPACE.
45160786Spsv262   12/16/94	Add -g/-G flag and screen_hilite.
45260786Spsv263   12/20/94	Reimplement/optimize -G flag behavior.
45360786Spsv264   12/23/94	Allow EXTRA string after line-edit cmd
45460786Sps		in lesskey file.
45560786Spsv265   12/24/94	Add LESSOPEN=|cmd syntax.
45660786Spsv266   12/26/94	Add -I flag.
45760786Spsv267   12/28/94	Formalize the four-byte header emitted
45860786Sps		by a LESSOPEN pipe.
45960786Spsv268   12/28/94	Get rid of four-byte header.
46060786Spsv269   1/2/95	Close alt file before open new one.
46160786Sps		Avoids multiple popen().
46260786Spsv270   1/3/95	Use VISUAL; use S_ISDIR/S_ISREG; fix
46360786Sps		config problem with Solaris POSIX regcomp.
46460786Spsv271   1/4/95	Don't quit on read error.
46560786Spsv272   1/5/95	Get rid of -L.
46660786Spsv273   1/6/95	Fix ch_ungetchar bug; don't call
46760786Sps		LESSOPEN on a pipe.
46860786Spsv274   1/6/95	Ported to OS/2 (thanks to Kai Uwe Rommel)
46960786Spsv275   1/18/95	Fix bug if toggle -G at EOF.
47060786Spsv276   1/30/95	Fix OS/2 version.
47160786Spsv277   1/31/95	Add "next" charset; don't display ^X
47260786Sps		for X > 128.
47360786Spsv278   2/14/95	Change default for -G.
47460786Sps		Posted to prep.ai.mit.edu
47560786Sps-----------------------------------------------------------------
47660786Spsv279   2/22/95	Add GNU options --help, --version.
47760786Sps		Minor config fixes.
47860786Spsv280   2/24/95	Clean up calls to glob(); don't set #
47960786Sps		if we can't open the new file.
48060786Spsv281   2/24/95	Repeat search should turn on hilites.
48160786Spsv282   3/2/95	Minor fixes.
48260786Spsv283   3/2/95	Fix homefile; make OS2 look in $HOME.
48360786Spsv284   3/2/95	Error if "v" on LESSOPENed file;
48460786Sps		"%" figures out file size on pipe.
48560786Spsv285   3/7/95	Don't set # in lsystem;
48660786Sps		lesskey try $HOME first.
48760786Spsv286   3/7/95	Reformat change history (too much free time?).
48860786Spsv287   3/8/95	Fix hilite bug if overstrike multiple chars.
48960786Spsv288   3/8/95	Allow lesskey to override get_editkey keys.
49060786Spsv289   3/9/95	Fix adj_hilite bug when line gets processed by
49160786Sps		hilite_line more than once.
49260786Spsv290   3/9/95	Make configure automatically.  Fix Sequent problem
49360786Sps		with incompatible sigsetmask().
49460786Sps		Posted to prep.ai.mit.edu
49560786Sps-----------------------------------------------------------------
49660786Spsv291   3/21/95	Add #env to lesskey.  Fix MS-DOS build.
49760786Sps		Posted to simtel.
49860786Sps-----------------------------------------------------------------
49960786Spsv292   4/24/95	Add MS-DOS support for Borland C.
50060786Sps		Fix arrow keys in MS-DOS versions.
50160786Spsv293   4/28/95	Add auto-versioning stuff to make dist.
50260786Spsv294   5/12/95	Fix Borland build.
50360786Spsv295   1/20/96	Fix search on squished file; add /@@.
50460786Spsv296   1/23/96	Allow cmdbuf larger than screen width.
50560786Spsv297   1/24/96	Don't call termcap if tgetent fails;
50660786Sps		add #defines for buffers.
50760786Spsv298   1/24/96	Change @@ to ^K.
50860786Sps		Add alternate search modifiers ^N, ^F, ^E.
50960786Spsv299   1/25/96	Fix percent overflow in jump_percent (thanks to Brent Wiese);
51060786Sps		don't send "ti" after shell command till RETURN pressed.
51160786Spsv300   1/25/96	Change -U to print tabs as ^I.
51260786Spsv301   1/30/96	Make hilites work in cmd F output.
51360786Spsv302   1/31/96	Fix cmd F to notice window-change signals.
51460786Spsv303   1/31/96	Add ESC-SPACE command.
51560786Spsv304   2/1/96	Add ^R search modifier; add LESSSECURE.
51660786Spsv305   2/2/96	Workaround Linux /proc kernel bug; add LESSKEY.
51760786Spsv306   3/16/96	Minor fixes.
51860786Spsv307   3/25/96	Allow cmd line arg "--"; fix DOS & OS/2 defines.h.
51960786Spsv308   4/4/96	Port to OS-9 (thanks to Boisy Pitre); fix -d.
52060786Spsv309   4/9/96	Fix OS-9 version; fix tags bug with "$".
52160786Spsv310   4/10/96	Get rid of HELPFILE.
52260786Spsv311   4/22/96	Add Windows32 support; merge doscreen.c into screen.c.
52360786Spsv312   4/24/96	Don't quit after "cannot reopen" error.
52460786Spsv313   4/25/96	Added horizontal scrolling.
52560786Spsv314   4/26/96	Modified -e to quit on reaching end of a squished file.
52660786Spsv315   4/26/96	Fix "!;TAB" bug.
52760786Spsv316   5/2/96	Make "|a" when (a < curr screen) go to end of curr screen.
52860786Spsv317   5/14/96	Various fixes for the MS-DOS and OS/2 builds.
52960786Sps		Added ## and %% handling for filenames
53060786Spsv318   5/29/96	Port to OS-9 Microware compiler; minor fixes
53160786Sps		(thanks to Martin Gregorie).
53260786Spsv319   7/8/96	Fix Windows port (thanks to Jeff Paquette).
53360786Spsv320   7/11/96	Final fixes for Windows port.
53460786Spsv321   7/18/96	Minor fixes.
53560786Sps		Posted to Web page.
53660786Sps-----------------------------------------------------------------
53760786Spsv322   8/13/96	Fix bug in shell escape from help file; add support for
53860786Sps		Microsoft Visual C under Windows; numerous small fixes.
53960786Spsv323   8/19/96	Fixes for Windows version (thanks to Simon Munton);
54060786Sps		fix for Linux library weirdness (thanks to Jim Diamond);
54160786Sps		port to DJGPP (thanks to Eli Zaretskii).
54260786Spsv324   8/21/96	Add support for spaces in filenames (thanks to Simon Munton).
54360786Spsv325   8/21/96	Add lessecho, for spaces in filenames under Unix.
54460786Spsv326   8/27/96	Fix DJGPP version.
54560786Spsv327   9/1/96	Reorganize lglob, make spaces in filenames work better in Unix.
54660786Spsv328   10/7/96	Append / to directory name in filename completion.
54760786Sps		Fix MS-DOS and OS-9 versions.
54860786Spsv329   10/11/96	Fix more MS-DOS bugs; add LESSSEPARATOR; add -" option.
54960786Sps		Add LESSMETACHARS, LESSMETAESCAPE.
55060786Spsv330   10/21/96	Minor fixes.
55160786Sps		Posted to Web page.
55260786Sps-----------------------------------------------------------------
55360786Spsv331   4/22/97	Various Windows fixes (thanks to Gurusamy Sarathy).
55460786Spsv332   4/22/97	Enter filenames from cmd line into edit history.
55560786Sps		Posted to Web page.
55660786Sps-----------------------------------------------------------------
55760786Spsv333    3/4/99	Changed -w to highlite new line after forward movement.
55860786Spsv334    3/9/99	Avoid overflowing prompt buffer; add %d and %D.
55960786Spsv335   3/20/99	Add EBCDIC support (thanks to Thomas Dorner).
56060786Sps              	Use HOMEDRIVE/HOMEPATH on Windows (thanks to Preston Bannister).
56160786Sps		Posted to Web page.
56260786Sps-----------------------------------------------------------------
56360786Spsv336    4/8/99	Fix installation bugs.
56460786Spsv337    4/9/99	Fix another installation bug.
56560786Sps		Posted to Web page.
56660786Sps-----------------------------------------------------------------
56760786Spsv338   4/13/99	Add support for long option names.
56860786Spsv339   4/18/99	Add \k, long option names to lesskey.  Add -^P.  Add :d.
56960786Spsv340   4/21/99	Add regexec2.  Fix Windows build.
57060786Sps		Posted to Web page.
57160786Sps-----------------------------------------------------------------
57260786Spsv341    5/6/99  Add -F option; %c & ?c prompt escapes.
57360786Sps		(Thanks to Michele Maltoni)
57460786Spsv342   7/22/99  Add system-wide lesskey file; allow GPL or Less License.
57560786Spsv343   9/23/99	Support UTF-8 (Thanks to Robert Brady).
57660786Sps		Add %P and ?P in prompts.
57760786Spsv344  10/27/99	-w highlights target line of g and p commands.
57860786Spsv345  10/29/99	Make -R pass thru ESC but not other control chars.
57960786Sps		Posted to Web page.
58060786Sps-----------------------------------------------------------------
58160786Spsv346   11/4/99  Fix bugs in long option processing; R cmd should clear hilites.
58260786Sps		Posted to Web page.
58360786Sps-----------------------------------------------------------------
58460786Spsv347  12/13/99	Fixes for DJGPP version (thanks to Eli Zaretskii).
58560786Spsv348  12/28/99	Fix deleting file with marks (thanks to Dimitar Jekov).
58660786Sps		Fix color problem in DJGPP version (thanks to Eli Zaretskii).
58760786Spsv349   1/24/00	Fix minor DJGPP bugs; check environment vars for UTF-8;
58860786Sps		add --with-editor (thanks to Eli, Markus Kuhn, Thomas Schoepf).
58960786Spsv350   3/1/00	Fix clear-while-standout bug.
59060786Spsv351   3/5/00	Change -M and = prompts to show top & bottom line number.
59160786Sps		Posted to Web page.
59260786Sps-----------------------------------------------------------------
59360786Spsv352   3/8/00	Fix scan_option NULL dereference.
59460786Sps-----------------------------------------------------------------
59560786Spsv353   3/20/00	Fix SECURE compile bug, allow space after numeric option.
59660786Spsv354   3/23/00	Add support for PCRE; add --with-regex configure option.
59763128Sps-----------------------------------------------------------------
59863128Spsv355   6/28/00	Add -# option (thanks to Andy Levinson).
59963128Spsv356   7/5/00	Add -J option.
60063128Spsv357   7/6/00	Support sigprocmask.
60163128Sps-----------------------------------------------------------------
60263128Spsv358   7/8/00	Fix problems with #stop in lesskey file.
60389019Sps		Posted to Web page.
60489019Sps-----------------------------------------------------------------
60589019Spsv359  9/10/00	Fixes for Win32 display problems (thanks to Maurizio Vairani).
60689019Spsv360  1/17/01	Move sysless to etc.
60789019Spsv361  12/4/01	Add IBM-1047 charset & EBCDIC fixes (thanks to Thomas Dorner).
60889019Sps		Fix 32 bit dependencies (thanks to Paul Eggert).
60989019Sps		Fix UTF-8 overstriking (thanks to Robert Brady).
61089019Spsv362  12/4/01	Make status column show search targets.
61189019Spsv363  12/6/01	Add --no-keypad option.
61289019Sps		Add variable width tabstops (thanks to Peter Samuelson).
61389019Spsv364 12/10/01	Better handling of very long lines in input;
61489019Sps		Fix horizontal shifting of colored text.
61589019Spsv365 12/11/01	Fix overstriking of tabs;
61689019Sps		Add support for global(1) and multiple tag matches
61789019Sps		(thanks to Shigio Yamaguchi and Tim Vanderhoek).
61889019Spsv366 12/11/01	Fixes for OS/2 (thanks to Kyosuke Tokoro).
61989019Spsv367 12/13/01	Allow -D and -x options to terminate without dollar sign;
62089019Sps		Right/left arrow when entering N are shift cmds, not line edit.
62189019Spsv368 12/18/01	Update lesskey commands.
62289019Spsv370 12/23/01	Fix tags error messages.
62389019Sps		Posted to Web page.
62489019Sps-----------------------------------------------------------------
62589019Spsv371 12/26/01	Fix new_file bug; use popen in Windows version;
62689019Sps		fix some compiler warnings.
627128345Stjrv372 12/29/01	Make -b be in units of 1K.
628128345Stjrv373  1/14/02	Improve handling of filenames containing shell metachars.
629128345Stjrv374   2/7/02	Fix memory leak; fix bug in -x argument parsing.
630128345Stjrv375   4/7/02	Fix searching for SGR sequences; fix SECURE build;
631128345Stjr		add SGR support to DJGPP version (thanks to Eli Zaretskii).
632128345Stjrv376  6/10/02	Fix bug in overstriking mulitbyte UTF-8 characters
633128345Stjr		(thanks to Jungshik Shin).
634128345Stjr		Posted to Web page.
635128345Stjr-----------------------------------------------------------------
636128345Stjrv377  9/10/02	Fix bug in Windows version when file contains CR;
637128345Stjr		fix bug in search highlights with -R;
638128345Stjr		make initial buffer limit really be 64K not unlimited.
639128345Stjrv378  9/30/02	Misc bug fixes and compiler warning cleanup.
640128345Stjr		Posted to Web page.
641128345Stjr-----------------------------------------------------------------
642128345Stjrv379 11/23/02	Add -L option; fix bug with ctrl-K in lesskey files;
643128345Stjr		improve UTF-8 overstriking and underscore overstriking;
644128345Stjr		fix minor man page problems; change to autoconf 2.54.
645128345Stjrv380 11/24/02	Make LINENUM same as POSITION.
646128345Stjrv381 11/28/02	Make -N use 7 columns for line number if possible.
64760786Sps*/
64860786Sps
649128345Stjrchar version[] = "381";
650