[BACK]Return to version.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / less

Annotation of src/usr.bin/less/version.c, Revision 1.5

1.1       etheisen    1: /*
1.3       millert     2:  * Copyright (C) 1984-2002  Mark Nudelman
1.1       etheisen    3:  *
1.3       millert     4:  * You may distribute under the terms of either the GNU General Public
                      5:  * License or the Less License, as specified in the README file.
1.1       etheisen    6:  *
1.3       millert     7:  * For more information about less, or for information on how to
                      8:  * contact the author, see the README file.
1.1       etheisen    9:  */
                     10:
                     11:
                     12: /*
                     13: ----------------------- CHANGE HISTORY --------------------------
                     14:
1.3       millert    15:        1/29/84 Allowed use on standard input
                     16:        2/1/84  Added E, N, P commands
                     17:        4/17/84 Added '=' command, 'stop' signal handling
                     18:        4/20/84 Added line folding
1.1       etheisen   19: v2     4/27/84 Fixed '=' command to use BOTTOM_PLUS_ONE,
1.3       millert    20:                instead of TOP, added 'p' & 'v' commands
                     21: v3     5/3/84  Added -m and -t options, '-' command
                     22: v4     5/3/84  Added LESS environment variable
                     23: v5     5/3/84  New comments, fixed '-' command slightly
                     24: v6     5/15/84 Added -Q, visual bell
1.1       etheisen   25: v7     5/24/84 Fixed jump_back(n) bug: n should count real
                     26:                lines, not folded lines.  Also allow number on G command.
1.3       millert    27: v8     5/30/84 Re-do -q and -Q commands
                     28: v9     9/25/84 Added "+<cmd>" argument
                     29: v10    10/10/84        Fixed bug in -b<n> argument processing
                     30: v11    10/18/84        Made error() ring bell if \n not entered.
1.1       etheisen   31: -----------------------------------------------------------------
                     32: v12    2/13/85 Reorganized signal handling and made portable to 4.2bsd.
1.3       millert    33: v13    2/16/85 Reword error message for '-' command.
                     34: v14    2/22/85 Added -bf and -bp variants of -b.
                     35: v15    2/25/85 Miscellaneous changes.
                     36: v16    3/13/85 Added -u flag for backspace processing.
                     37: v17    4/13/85 Added j and k commands, changed -t default.
                     38: v18    4/20/85 Rewrote signal handling code.
                     39: v19    5/2/85  Got rid of "verbose" eq_message().
1.1       etheisen   40:                Made search() scroll in some cases.
1.3       millert    41: v20    5/21/85 Fixed screen.c ioctls for System V.
                     42: v21    5/23/85 Fixed some first_cmd bugs.
                     43: v22    5/24/85 Added support for no RECOMP nor REGCMP.
                     44: v23    5/25/85 Miscellanous changes and prettying up.
1.1       etheisen   45:                Posted to USENET.
                     46: -----------------------------------------------------------------
                     47: v24    6/3/85  Added ti,te terminal init & de-init.
                     48:                (Thanks to Mike Kersenbrock)
1.3       millert    49: v25    6/8/85  Added -U flag, standout mode underlining.
                     50: v26    6/9/85  Added -M flag.
1.1       etheisen   51:                Use underline termcap (us) if it exists.
1.3       millert    52: v27    6/15/85 Renamed some variables to make unique in
1.1       etheisen   53:                6 chars.  Minor fix to -m.
1.3       millert    54: v28    6/28/85 Fixed right margin bug.
                     55: v29    6/28/85 Incorporated M.Rose's changes to signal.c
                     56: v30    6/29/85 Fixed stupid bug in argument processing.
1.1       etheisen   57: v31    7/15/85 Added -p flag, changed repaint algorithm.
                     58:                Added kludge for magic cookie terminals.
1.3       millert    59: v32    7/16/85 Added cat_file if output not a tty.
                     60: v33    7/23/85 Added -e flag and EDITOR.
                     61: v34    7/26/85 Added -s flag.
                     62: v35    7/27/85 Rewrote option handling; added option.c.
                     63: v36    7/29/85 Fixed -e flag to work if not last file.
                     64: v37    8/10/85 Added -x flag.
                     65: v38    8/19/85 Changed prompting; created prompt.c.
                     66: v39    8/24/85 (Not -p) does not initially clear screen.
                     67: v40    8/26/85 Added "skipping" indicator in forw().
1.1       etheisen   68:                Posted to USENET.
                     69: -----------------------------------------------------------------
1.3       millert    70: v41    9/17/85 ONLY_RETURN, control char commands,
1.1       etheisen   71:                faster search, other minor fixes.
1.3       millert    72: v42    9/25/85 Added ++ command line syntax;
1.1       etheisen   73:                ch_fsize for pipes.
1.3       millert    74: v43    10/15/85        Added -h flag, changed prim.c algorithms.
                     75: v44    10/16/85        Made END print in all cases of eof;
1.1       etheisen   76:                ignore SIGTTOU after receiv ing SIGTSTP.
1.3       millert    77: v45    10/16/85        Never print backspaces unless -u.
                     78: v46    10/24/85        Backwards scroll in jump_loc.
                     79: v47    10/30/85        Fixed bug in edit(): *first_cmd==0
                     80: v48    11/16/85        Use TIOCSETN instead of TIOCSETP.
1.1       etheisen   81:                Added marks (m and ' commands).
                     82:                Posted to USENET.
                     83: -----------------------------------------------------------------
1.3       millert    84: v49    1/9/86  Fixed bug: signal didn't clear mcc.
                     85: v50    1/15/86 Added ' (quote) to gomark.
1.1       etheisen   86: v51    1/16/86 Added + cmd, fixed problem if first_cmd
                     87:                fails, made g cmd sort of "work" on pipes
1.3       millert    88:                ev en if bof is no longer buffered.
                     89: v52    1/17/86 Made short files work better.
                     90: v53    1/20/86 Added -P option.
                     91: v54    1/20/86 Changed help to use HELPFILE.
                     92: v55    1/23/86 Messages work better if not tty output.
                     93: v56    1/24/86 Added -l option.
1.1       etheisen   94: v57    1/31/86 Fixed -l to get confirmation before
1.3       millert    95:                ov erwriting an existing file.
                     96: v58    8/28/86 Added filename globbing.
                     97: v59    9/15/86 Fixed some bugs with very long filenames.
1.1       etheisen   98: v60    9/26/86 Incorporated changes from Leith (Casey)
1.3       millert    99:                Leedom for boldface and -z option.
                    100: v61    9/26/86 Got rid of annoying repaints after ! cmd.
1.1       etheisen  101:                Posted to USENET.
                    102: -----------------------------------------------------------------
                    103: v62    12/23/86        Added is_directory(); change -z default to
                    104:                -1 instead of 24; cat-and-exit if -e and
1.3       millert   105:                file is less than a screenful.
                    106: v63    1/8/87  Fixed bug in cat-and-exit if > 1 file.
1.1       etheisen  107: v64    1/12/87 Changed puts/putstr, putc/putchr,
                    108:                getc/getchr to av oid name conflict with
1.3       millert   109:                stdio functions.
1.1       etheisen  110: v65    1/26/87 Allowed '-' command to change NUMBER
1.3       millert   111:                v alued options (thanks to Gary Puckering)
                    112: v66    2/13/87 Fixed bug: prepaint should use force=1.
                    113: v67    2/24/87 Added !! and % expansion to ! command.
1.1       etheisen  114: v68    2/25/87 Added SIGWINCH and TIOCGWINSZ support;
                    115:                changed is_directory to bad_file.
1.3       millert   116:                (thanks to J. Robert Ward)
                    117: v69    2/25/87 Added SIGWIND and WIOCGETD (for Unix PC).
1.1       etheisen  118: v70    3/13/87 Changed help cmd from 'h' to 'H'; better
1.3       millert   119:                error msgs in bad_file, errno_message.
1.1       etheisen  120: v71    5/11/87 Changed -p to -c, made triple -c/-C
1.3       millert   121:                for clear-eol like more's -c.
                    122: v72    6/26/87 Added -E, -L, use $SHELL in lsystem().
1.1       etheisen  123:                (thanks to Stev e Spearman)
1.3       millert   124: v73    6/26/87 Allow Examine "#" for previous file.
1.1       etheisen  125:                Posted to USENET 8/25/87.
                    126: -----------------------------------------------------------------
1.3       millert   127: v74    9/18/87 Fix conflict in EOF symbol with stdio.h,
1.1       etheisen  128:                Make os.c more portable to BSD.
1.3       millert   129: v75    9/23/87 Fix problems in get_term (thanks to
1.1       etheisen  130:                Paul Eggert); new backwards scrolling in
                    131:                jump_loc (thanks to Marion Hakanson).
1.3       millert   132: v76    9/23/87 Added -i flag; allow single "!" to
1.1       etheisen  133:                inv oke a shell (thanks to Franco Barber).
1.3       millert   134: v77    9/24/87 Added -n flag and line number support.
                    135: v78    9/25/87 Fixed problem with prompts longer than
1.1       etheisen  136:                the screen width.
1.3       millert   137: v79    9/29/87 Added the _ command.
                    138: v80    10/6/87 Allow signal to break out of linenum scan.
                    139: v81    10/6/87 Allow -b to be changed from within less.
                    140: v82    10/7/87 Add cmd_decode to use a table for key
1.1       etheisen  141:                binding (thanks to Dav id Nason).
1.3       millert   142: v83    10/9/87 Allow .less file for user-defined keys.
                    143: v84    10/11/87        Fix -e/-E problems (thanks to Felix Lee).
                    144: v85    10/15/87        Search now keeps track of line numbers.
                    145: v86    10/20/87        Added -B option and autobuf; fixed
1.1       etheisen  146:                "pipe error" bug.
1.3       millert   147: v87    3/1/88  Fix bug re BSD signals while reading file.
                    148: v88    3/12/88 Use new format for -P option (thanks to
1.1       etheisen  149:                der Mouse), allow "+-c" without message,
                    150:                fix bug re BSD hangup.
1.3       millert   151: v89    3/18/88 Turn off line numbers if linenum scan
1.1       etheisen  152:                is interrupted.
1.3       millert   153: v90    3/30/88 Allow -P from within less.
                    154: v91    3/30/88 Added tags file support (new -t option)
1.1       etheisen  155:                (thanks to Brian Campbell).
1.3       millert   156: v92    4/4/88  Added -+option syntax.
                    157: v93    4/11/88 Add support for slow input (thanks to
1.1       etheisen  158:                Joe Orost & apologies for taking almost
                    159:                3 years to get this in!)
1.3       millert   160: v94    4/11/88 Redo reading/signal stuff.
                    161: v95    4/20/88 Repaint screen better after signal.
                    162: v96    4/21/88 Add /! and ?! commands.
                    163: v97    5/17/88 Allow -l/-L from within less.
1.1       etheisen  164:                Eliminate some static arrays (use calloc).
                    165:                Posted to USENET.
                    166: -----------------------------------------------------------------
1.3       millert   167: v98    10/14/88        Fix incorrect calloc call; uninitialized
1.1       etheisen  168:                var in exec_mca; core dump on unknown TERM.
                    169:                Make v cmd work if past last line of file.
                    170:                Fix some signal bugs.
1.3       millert   171: v99    10/29/88        Allow space between -X and string,
1.1       etheisen  172:                when X is a string-valued option.
1.3       millert   173: v100   1/5/89  Fix globbing bug when $SHELL not set;
1.1       etheisen  174:                allow spaces after -t command.
1.3       millert   175: v101   1/6/89  Fix problem with long (truncated) lines
1.1       etheisen  176:                in tags file (thanks to Neil Dixon).
1.3       millert   177: v102   1/6/89  Fix bug with E# when no prev file;
1.1       etheisen  178:                allow spaces after -l command.
1.3       millert   179: v103   3/14/89 Add -N, -f and -? options.  Add z and w
1.1       etheisen  180:                commands.  Add %L for prompt strings.
1.3       millert   181: v104   3/16/89 Added EDITPROTO.
                    182: v105   3/20/89 Fix bug in find_linenum which cached
1.1       etheisen  183:                incorrectly on long lines.
                    184: v106   3/31/89 Added -k option and multiple lesskey
                    185:                files.
1.3       millert   186: v107   4/27/89 Add 8-bit char support and -g option.
1.1       etheisen  187:                Split option code into 3 files.
                    188: v108   5/5/89  Allocate position table dynamically
                    189:                (thanks to Paul Eggert); change % command
                    190:                from "percent" to vi-style brace finder.
1.3       millert   191: v109   5/10/89 Added ESC-% command, split prim.c.
                    192: v110   5/24/89 Fixed bug in + option; fixed repaint bug
1.1       etheisen  193:                under Sun windows (thanks to Paul Eggert).
1.3       millert   194: v111   5/25/89 Generalized # and % expansion; use
1.1       etheisen  195:                calloc for some error messages.
1.3       millert   196: v112   5/30/89 Get rid of ESC-%, add {}()[] commands.
                    197: v113   5/31/89 Optimize lseeks (thanks to Paul Eggert).
                    198: v114   7/25/89 Added ESC-/ and ESC-/! commands.
                    199: v115   7/26/89 Added ESC-n command.
                    200: v116   7/31/89 Added find_pos to optimize g command.
                    201: v117   8/1/89  Change -f option to -r.
                    202: v118   8/2/89  Save positions for all previous files,
1.1       etheisen  203:                not just the immediately previous one.
1.3       millert   204: v119   8/7/89  Save marks across file boundaries.
1.1       etheisen  205:                Add file handle stuff.
1.3       millert   206: v120   8/11/89 Add :ta command.
                    207: v121   8/16/89 Add -f option.
                    208: v122   8/30/89 Fix performance with many buffers.
                    209: v123   8/31/89 Verbose prompts for string options.
1.1       etheisen  210:                Posted beta to USENET.
                    211: -----------------------------------------------------------------
1.3       millert   212: v124   9/18/89 Reorganize search commands,
1.1       etheisen  213:                N = rev, ESC-n = span, add ESC-N.
1.3       millert   214: v125   9/18/89 Fix tab bug (thanks to Alex Liu).
1.1       etheisen  215:                Fix EOF bug when both -w and -c.
1.3       millert   216: v126   10/25/89        Add -j option.
                    217: v127   10/27/89        Fix problems with blank lines before BOF.
                    218: v128   10/27/89        Add %bj, etc. to prompt strings.
                    219: v129   11/3/89 Add -+,-- commands; add set-option and
1.1       etheisen  220:                unset-option to lesskey.
1.3       millert   221: v130   11/6/89 Generalize A_EXTRA to string, remove
1.1       etheisen  222:                set-option, unset-option from lesskey.
1.3       millert   223: v131   11/7/89 Changed name of EDITPROTO to LESSEDIT.
                    224: v132   11/8/89 Allow editing of command prefix.
                    225: v133   11/16/89        Add -y option (thanks to Jeff Sullivan).
                    226: v134   12/1/89 Glob filenames in the -l command.
                    227: v135   12/5/89 Combined {}()[] commands into one, and
1.1       etheisen  228:                added ESC-^F and ESC-^B commands.
1.3       millert   229: v136   1/20/90 Added -S, -R flags.  Added | command.
1.1       etheisen  230:                Added warning for binary files. (thanks
                    231:                to Richard Brittain and J. Sullivan).
1.3       millert   232: v137   1/21/90 Rewrote horrible pappend code.
1.1       etheisen  233:                Added * notation for hi-bit chars.
1.3       millert   234: v138   1/24/90 Fix magic cookie terminal handling.
1.1       etheisen  235:                Get rid of "cleanup" loop in ch_get.
1.3       millert   236: v139   1/27/90 Added MSDOS support.  (many thanks
1.1       etheisen  237:                to Richard Brittain).
1.3       millert   238: v140   2/7/90  Editing a new file adds it to the
1.1       etheisen  239:                command line list.
1.3       millert   240: v141   2/8/90  Add edit_list for editing >1 file.
                    241: v142   2/10/90 Add :x command.
                    242: v143   2/11/90 Add * and @ modifies to search cmds.
1.1       etheisen  243:                Change ESC-/ cmd from /@* to / *.
1.3       millert   244: v144   3/1/90  Messed around with ch_zero;
1.1       etheisen  245:                no real change.
1.3       millert   246: v145   3/2/90  Added -R and -v/-V for MSDOS;
1.1       etheisen  247:                renamed FILENAME to avoid conflict.
1.3       millert   248: v146   3/5/90  Pull cmdbuf functions out of command.c
                    249: v147   3/7/90  Implement ?@; fix multi-file edit bugs.
                    250: v148   3/29/90 Fixed bug in :e<file> then :e#.
                    251: v149   4/3/90  Change error,ierror,query to use PARG.
                    252: v150   4/6/90  Add LESS_CHARSET, LESS_CHARDEF.
                    253: v151   4/13/90 Remove -g option; clean up ispipe.
                    254: v152   4/14/90 lsystem() closes input file, for
1.1       etheisen  255:                editors which require exclusive open.
1.3       millert   256: v153   4/18/90 Fix bug if SHELL unset;
1.1       etheisen  257:                fix bug in overstrike control char.
1.3       millert   258: v154   4/25/90 Output to fd 2 via buffer.
                    259: v155   4/30/90 Ignore -i if uppercase in pattern
1.1       etheisen  260:                (thanks to Michael Rendell.)
1.3       millert   261: v156   5/3/90  Remove scroll limits in forw() & back();
1.1       etheisen  262:                causes problems with -c.
1.3       millert   263: v157   5/4/90  Forward search starts at next real line
1.1       etheisen  264:                (not screen line) after jump target.
1.3       millert   265: v158   6/14/90 Added F command.
                    266: v159   7/29/90 Fix bug in exiting: output not flushed.
                    267: v160   7/29/90 Clear screen before initial output w/ -c.
                    268: v161   7/29/90 Add -T flag.
                    269: v162   8/14/90 Fix bug with +F on command line.
                    270: v163   8/21/90 Added LESSBINFMT variable.
                    271: v164   9/5/90  Added -p, LINES, COLUMNS and
1.1       etheisen  272:                unset mark ' == BOF, for 1003.2 D5.
1.3       millert   273: v165   9/6/90  At EOF with -c set, don't display empty
1.1       etheisen  274:                screen when try to page forward.
1.3       millert   275: v166   9/6/90  Fix G when final line in file wraps.
                    276: v167   9/11/90 Translate CR/LF -> LF for 1003.2.
                    277: v168   9/13/90 Return to curr file if "tag not found".
                    278: v169   12/12/90        G goes to EOF even if file has grown.
                    279: v170   1/17/91 Add optimization for BSD _setjmp;
1.1       etheisen  280:                fix #include ioctl.h TERMIO problem.
                    281:                (thanks to Paul Eggert)
                    282:                Posted to USENET.
                    283: -----------------------------------------------------------------
1.3       millert   284: v171   3/6/91  Fix -? bug in get_filename.
                    285: v172   3/15/91 Fix G bug in empty file.
1.1       etheisen  286:                Fix bug with ?\n and -i and uppercase
                    287:                pattern at EOF!
                    288:                (thanks to Paul Eggert)
1.3       millert   289: v173   3/17/91 Change N cmd to not permanently change
1.1       etheisen  290:                direction. (thanks to Brian Matthews)
1.3       millert   291: v174   3/18/91 Fix bug with namelogfile not getting
1.1       etheisen  292:                cleared when change files.
1.3       millert   293: v175   3/18/91 Fix bug with ++cmd on command line.
1.1       etheisen  294:                (thanks to Jim Meyering)
1.3       millert   295: v176   4/2/91  Change | to not force current screen,
1.1       etheisen  296:                include marked line, start/end from
                    297:                top of screen.  Improve search speed.
                    298:                (thanks to Don Mears)
1.3       millert   299: v177   4/2/91  Add LESSHELP variable.
1.1       etheisen  300:                Fix bug with F command with -e.
                    301:                Try /dev/tty for input before using fd 2.
                    302:                Patches posted to USENET  4/2/91.
                    303: -----------------------------------------------------------------
1.3       millert   304: v178   4/8/91  Fixed bug in globbing logfile name.
1.1       etheisen  305:                (thanks to Jim Meyering)
1.3       millert   306: v179   4/9/91  Allow negative -z for screen-relative.
                    307: v180   4/9/91  Clear to eos rather than eol if "db";
1.1       etheisen  308:                don't use "sr" if "da".
                    309:                (thanks to Tor Lillqvist)
1.3       millert   310: v181   4/18/91 Fixed bug with "negative" chars 80 - FF.
1.1       etheisen  311:                (thanks to Benny Sander Hofmann)
1.3       millert   312: v182   5/16/91 Fixed bug with attribute at EOL.
1.1       etheisen  313:                (thanks to Brian Matthews)
1.3       millert   314: v183   6/1/91  Rewrite linstall to do smart config.
                    315: v184   7/11/91 Process \b in searches based on -u
1.1       etheisen  316:                rather than -i.
1.3       millert   317: v185   7/11/91 -Pxxx sets short prompt; assume SIGWINCH
1.1       etheisen  318:                after a SIGSTOP. (thanks to Ken Laprade)
                    319: -----------------------------------------------------------------
1.3       millert   320: v186   4/20/92 Port to MS-DOS (Microsoft C).
                    321: v187   4/23/92 Added -D option & TAB_COMPLETE_FILENAME.
                    322: v188   4/28/92 Added command line editing features.
                    323: v189   12/8/92 Fix mem overrun in anscreen.c:init;
1.1       etheisen  324:                fix edit_list to recover from bin file.
1.3       millert   325: v190   2/13/93 Make TAB enter one filename at a time;
1.1       etheisen  326:                create ^L with old TAB functionality.
1.3       millert   327: v191   3/10/93 Defer creating "flash" page for MS-DOS.
                    328: v192   9/6/93  Add BACK-TAB.
                    329: v193   9/17/93 Simplify binary_file handling.
                    330: v194   1/4/94  Add rudiments of alt_filename handling.
                    331: v195   1/11/94 Port back to Unix; support keypad.
1.1       etheisen  332: -----------------------------------------------------------------
1.3       millert   333: v196   6/7/94  Fix bug with bad filename; fix IFILE
1.1       etheisen  334:                type problem. (thanks to David MacKenzie)
1.3       millert   335: v197   6/7/94  Fix bug with .less tables inserted wrong.
                    336: v198   6/23/94 Use autoconf installation technology.
1.1       etheisen  337:                (thanks to David MacKenzie)
1.3       millert   338: v199   6/29/94 Fix MS-DOS build (thanks to Tim Wiegman).
                    339: v200   7/25/94 Clean up copyright, minor fixes.
1.1       etheisen  340:        Posted to prep.ai.mit.edu
                    341: -----------------------------------------------------------------
1.3       millert   342: v201   7/27/94 Check for no memcpy; add casts to calloc;
1.1       etheisen  343:                look for regcmp in libgen.a.
                    344:                (thanks to Kaveh Ghazi).
1.3       millert   345: v202   7/28/94 Fix bug in edit_next/edit_prev with
1.4       jmc       346:                non-existent files.
1.3       millert   347: v203   8/2/94  Fix a variety of configuration bugs on
1.1       etheisen  348:                various systems. (thanks to Sakai
                    349:                Kiyotaka, Harald Koenig, Bjorn Brox,
                    350:                Teemu Rantanen, and Thorsten Lockert)
1.3       millert   351: v204   8/3/94  Use strerror if available.
1.1       etheisen  352:                (thanks to J.T. Conklin)
1.3       millert   353: v205   8/5/94  Fix bug in finding "me" termcap entry.
1.1       etheisen  354:                (thanks to Andreas Stolcke)
1.3       millert   355: 8/10/94        v205+: Change BUFSIZ to LBUFSIZE to avoid name
1.1       etheisen  356:                conflict with stdio.h.
                    357:                Posted to prep.ai.mit.edu
                    358: -----------------------------------------------------------------
1.3       millert   359: v206   8/10/94 Use initial_scrpos for -t to avoid
1.1       etheisen  360:                displaying first page before init().
                    361:                (thanks to Dominique Petitpierre)
1.3       millert   362: v207   8/12/94 Fix bug if stdout is not tty.
                    363: v208   8/16/94 Fix bug in close_altfile if goto err1
1.1       etheisen  364:                in edit_ifile. (Thanks to M.J. Hewitt)
1.3       millert   365: v209   8/16/94 Change scroll to wscroll to avoid
1.1       etheisen  366:                conflict with library function.
1.3       millert   367: v210   8/16/94 Fix bug with bold on 8 bit chars.
1.1       etheisen  368:                (thanks to Vitor Duarte)
1.3       millert   369: v211   8/16/94 Don't quit on EOI in jump_loc / forw.
                    370: v212   8/18/94 Use time_t if available.
                    371: v213   8/20/94 Allow ospeed to be defined in termcap.h.
                    372: v214   8/20/94 Added HILITE_SEARCH, -F, ESC-u cmd.
1.1       etheisen  373:                (thanks to Paul Lew and Bob Byrnes)
1.3       millert   374: v215   8/23/94 Fix -i toggle behavior.
                    375: v216   8/23/94 Process BS in all searches, not only -u.
                    376: v217   8/24/94 Added -X flag.
                    377: v218   8/24/94 Reimplement undo_search.
                    378: v219   8/24/94 Find tags marked with line number
1.1       etheisen  379:                instead of pattern.
1.3       millert   380: v220   8/24/94 Stay at same position after SIG_WINCH.
                    381: v221   8/24/94 Fix bug in file percentage in big file.
                    382: v222   8/25/94 Do better if can't reopen current file.
                    383: v223   8/27/94 Support setlocale.
1.1       etheisen  384:                (thanks to Robert Joop)
1.3       millert   385: v224   8/29/94 Revert v216: process BS in search
1.1       etheisen  386:                only if -u.
1.3       millert   387: v225   9/6/94  Rewrite undo_search again: toggle.
                    388: v226   9/15/94 Configuration fixes.
1.1       etheisen  389:                (thanks to David MacKenzie)
1.3       millert   390: v227   9/19/94 Fixed strerror config problem.
1.1       etheisen  391:                Posted to prep.ai.mit.edu
                    392: -----------------------------------------------------------------
1.3       millert   393: v228   9/21/94 Fix bug in signals: repeated calls to
1.1       etheisen  394:                get_editkeys overflowed st_edittable.
1.3       millert   395: v229   9/21/94 Fix "Nothing to search" error if -a
1.1       etheisen  396:                and SRCH_PAST_EOF.
1.3       millert   397: v230   9/21/94 Don't print extra error msg in search
1.1       etheisen  398:                after regerror().
1.3       millert   399: v231   9/22/94 Fix hilite bug if search matches 0 chars.
1.1       etheisen  400:                (thanks to John Polstra)
1.3       millert   401: v232   9/23/94 Deal with weird systems that have
1.1       etheisen  402:                termios.h but not tcgetattr().
                    403:                Posted to prep.ai.mit.edu
                    404: -----------------------------------------------------------------
1.3       millert   405: v233   9/26/94 Use get_term() instead of pos_init() in
1.1       etheisen  406:                psignals to re-get lower_left termcap.
                    407:                (Thanks to John Malecki)
1.3       millert   408: v234   9/26/94 Make MIDDLE closer to middle of screen.
                    409: v235   9/27/94 Use local strchr if system doesn't have.
                    410: v236   9/28/94 Don't use libucb; use libterm if
1.1       etheisen  411:                libtermcap & libcurses doesn't work.
                    412:                (Fix for Solaris; thanks to Frank Kaefer)
1.3       millert   413: v237   9/30/94 Use system isupper() etc if provided.
1.1       etheisen  414:                Posted to prep.ai.mit.edu
                    415: -----------------------------------------------------------------
1.3       millert   416: v238   10/6/94 Make binary non-blinking if LESSBINFMT
1.1       etheisen  417:                is set to a string without a *.
1.3       millert   418: v239   10/7/94 Don't let delimit_word run back past
1.1       etheisen  419:                beginning of cmdbuf.
1.3       millert   420: v240   10/10/94        Don't write into termcap buffer.
1.1       etheisen  421:                (Thanks to Benoit Speckel)
1.3       millert   422: v241   10/13/94        New lesskey file format.
1.1       etheisen  423:                Don't expand filenames in search command.
1.3       millert   424: v242   10/14/94        Allow lesskey specification of "literal".
                    425: v243   10/14/94        Add #stop command to lesskey.
                    426: v244   10/16/94        Add -f flag to lesskey.
                    427: v245   10/25/94        Allow TAB_COMPLETE_FILENAME to be undefd.
                    428: v246   10/27/94        Move help file to /usr/local/share.
                    429: v247   10/27/94        Add -V option.
                    430: v248   11/5/94 Add -V option to lesskey.
                    431: v249   11/5/94 Remove -f flag from lesskey; default
1.1       etheisen  432:                input file is ~/.lesskey.in, not stdin.
1.3       millert   433: v250   11/7/94 Lesskey input file "-" means stdin.
                    434: v251   11/9/94 Convert cfgetospeed result to ospeed.
1.1       etheisen  435:                (Thanks to Andrew Chernov)
1.3       millert   436: v252   11/16/94        Change default lesskey input file from
1.1       etheisen  437:                .lesskey.in to .lesskey.
                    438:                Posted to prep.ai.mit.edu
                    439: -----------------------------------------------------------------
1.3       millert   440: v253   11/21/94        Fix bug when tags file has a backslash.
                    441: v254   12/6/94 Fix -k option.
                    442: v255   12/8/94 Add #define EXAMINE to disable :e etc.
                    443: v256   12/10/94        Change highlighting: only highlite search
1.1       etheisen  444:                results (but now it is reliable).
1.3       millert   445: v257   12/10/94        Add goto_line and repaint_highlight
1.1       etheisen  446:                to optimize highlight repaints.
1.3       millert   447: v258   12/12/94        Fixup in hilite_line if BS_SPECIAL.
                    448: v259   12/12/94        Convert to autoconf 2.0.
                    449: v260   12/13/94        Add SECURE define.
                    450: v261   12/14/94        Use system WERASE char as EC_W_BACKSPACE.
                    451: v262   12/16/94        Add -g/-G flag and screen_hilite.
                    452: v263   12/20/94        Reimplement/optimize -G flag behavior.
                    453: v264   12/23/94        Allow EXTRA string after line-edit cmd
1.1       etheisen  454:                in lesskey file.
1.3       millert   455: v265   12/24/94        Add LESSOPEN=|cmd syntax.
                    456: v266   12/26/94        Add -I flag.
                    457: v267   12/28/94        Formalize the four-byte header emitted
1.1       etheisen  458:                by a LESSOPEN pipe.
1.3       millert   459: v268   12/28/94        Get rid of four-byte header.
                    460: v269   1/2/95  Close alt file before open new one.
1.1       etheisen  461:                Avoids multiple popen().
1.3       millert   462: v270   1/3/95  Use VISUAL; use S_ISDIR/S_ISREG; fix
1.1       etheisen  463:                config problem with Solaris POSIX regcomp.
1.3       millert   464: v271   1/4/95  Don't quit on read error.
                    465: v272   1/5/95  Get rid of -L.
                    466: v273   1/6/95  Fix ch_ungetchar bug; don't call
1.1       etheisen  467:                LESSOPEN on a pipe.
1.3       millert   468: v274   1/6/95  Ported to OS/2 (thanks to Kai Uwe Rommel)
                    469: v275   1/18/95 Fix bug if toggle -G at EOF.
                    470: v276   1/30/95 Fix OS/2 version.
                    471: v277   1/31/95 Add "next" charset; don't display ^X
1.1       etheisen  472:                for X > 128.
1.3       millert   473: v278   2/14/95 Change default for -G.
1.1       etheisen  474:                Posted to prep.ai.mit.edu
                    475: -----------------------------------------------------------------
1.3       millert   476: v279   2/22/95 Add GNU options --help, --version.
1.1       etheisen  477:                Minor config fixes.
1.3       millert   478: v280   2/24/95 Clean up calls to glob(); don't set #
1.1       etheisen  479:                if we can't open the new file.
1.3       millert   480: v281   2/24/95 Repeat search should turn on hilites.
                    481: v282   3/2/95  Minor fixes.
                    482: v283   3/2/95  Fix homefile; make OS2 look in $HOME.
                    483: v284   3/2/95  Error if "v" on LESSOPENed file;
1.1       etheisen  484:                "%" figures out file size on pipe.
1.3       millert   485: v285   3/7/95  Don't set # in lsystem;
1.1       etheisen  486:                lesskey try $HOME first.
                    487: v286   3/7/95  Reformat change history (too much free time?).
                    488: v287   3/8/95  Fix hilite bug if overstrike multiple chars.
                    489: v288   3/8/95  Allow lesskey to override get_editkey keys.
                    490: v289   3/9/95  Fix adj_hilite bug when line gets processed by
                    491:                hilite_line more than once.
                    492: v290   3/9/95  Make configure automatically.  Fix Sequent problem
                    493:                with incompatible sigsetmask().
1.3       millert   494:                Posted to prep.ai.mit.edu
                    495: -----------------------------------------------------------------
                    496: v291   3/21/95 Add #env to lesskey.  Fix MS-DOS build.
                    497:                Posted to simtel.
                    498: -----------------------------------------------------------------
                    499: v292   4/24/95 Add MS-DOS support for Borland C.
                    500:                Fix arrow keys in MS-DOS versions.
                    501: v293   4/28/95 Add auto-versioning stuff to make dist.
                    502: v294   5/12/95 Fix Borland build.
                    503: v295   1/20/96 Fix search on squished file; add /@@.
                    504: v296   1/23/96 Allow cmdbuf larger than screen width.
                    505: v297   1/24/96 Don't call termcap if tgetent fails;
                    506:                add #defines for buffers.
                    507: v298   1/24/96 Change @@ to ^K.
                    508:                Add alternate search modifiers ^N, ^F, ^E.
                    509: v299   1/25/96 Fix percent overflow in jump_percent (thanks to Brent Wiese);
                    510:                don't send "ti" after shell command till RETURN pressed.
                    511: v300   1/25/96 Change -U to print tabs as ^I.
                    512: v301   1/30/96 Make hilites work in cmd F output.
                    513: v302   1/31/96 Fix cmd F to notice window-change signals.
                    514: v303   1/31/96 Add ESC-SPACE command.
                    515: v304   2/1/96  Add ^R search modifier; add LESSSECURE.
                    516: v305   2/2/96  Workaround Linux /proc kernel bug; add LESSKEY.
                    517: v306   3/16/96 Minor fixes.
                    518: v307   3/25/96 Allow cmd line arg "--"; fix DOS & OS/2 defines.h.
                    519: v308   4/4/96  Port to OS-9 (thanks to Boisy Pitre); fix -d.
                    520: v309   4/9/96  Fix OS-9 version; fix tags bug with "$".
                    521: v310   4/10/96 Get rid of HELPFILE.
                    522: v311   4/22/96 Add Windows32 support; merge doscreen.c into screen.c.
                    523: v312   4/24/96 Don't quit after "cannot reopen" error.
                    524: v313   4/25/96 Added horizontal scrolling.
                    525: v314   4/26/96 Modified -e to quit on reaching end of a squished file.
                    526: v315   4/26/96 Fix "!;TAB" bug.
                    527: v316   5/2/96  Make "|a" when (a < curr screen) go to end of curr screen.
                    528: v317   5/14/96 Various fixes for the MS-DOS and OS/2 builds.
                    529:                Added ## and %% handling for filenames
                    530: v318   5/29/96 Port to OS-9 Microware compiler; minor fixes
                    531:                (thanks to Martin Gregorie).
                    532: v319   7/8/96  Fix Windows port (thanks to Jeff Paquette).
                    533: v320   7/11/96 Final fixes for Windows port.
                    534: v321   7/18/96 Minor fixes.
                    535:                Posted to Web page.
                    536: -----------------------------------------------------------------
                    537: v322   8/13/96 Fix bug in shell escape from help file; add support for
                    538:                Microsoft Visual C under Windows; numerous small fixes.
                    539: v323   8/19/96 Fixes for Windows version (thanks to Simon Munton);
                    540:                fix for Linux library weirdness (thanks to Jim Diamond);
                    541:                port to DJGPP (thanks to Eli Zaretskii).
                    542: v324   8/21/96 Add support for spaces in filenames (thanks to Simon Munton).
                    543: v325   8/21/96 Add lessecho, for spaces in filenames under Unix.
                    544: v326   8/27/96 Fix DJGPP version.
                    545: v327   9/1/96  Reorganize lglob, make spaces in filenames work better in Unix.
                    546: v328   10/7/96 Append / to directory name in filename completion.
                    547:                Fix MS-DOS and OS-9 versions.
                    548: v329   10/11/96        Fix more MS-DOS bugs; add LESSSEPARATOR; add -" option.
                    549:                Add LESSMETACHARS, LESSMETAESCAPE.
                    550: v330   10/21/96        Minor fixes.
                    551:                Posted to Web page.
                    552: -----------------------------------------------------------------
                    553: v331   4/22/97 Various Windows fixes (thanks to Gurusamy Sarathy).
                    554: v332   4/22/97 Enter filenames from cmd line into edit history.
                    555:                Posted to Web page.
                    556: -----------------------------------------------------------------
                    557: v333    3/4/99 Changed -w to highlite new line after forward movement.
                    558: v334    3/9/99 Avoid overflowing prompt buffer; add %d and %D.
                    559: v335   3/20/99 Add EBCDIC support (thanks to Thomas Dorner).
                    560:                Use HOMEDRIVE/HOMEPATH on Windows (thanks to Preston Bannister).
                    561:                Posted to Web page.
                    562: -----------------------------------------------------------------
                    563: v336    4/8/99 Fix installation bugs.
                    564: v337    4/9/99 Fix another installation bug.
                    565:                Posted to Web page.
                    566: -----------------------------------------------------------------
                    567: v338   4/13/99 Add support for long option names.
                    568: v339   4/18/99 Add \k, long option names to lesskey.  Add -^P.  Add :d.
                    569: v340   4/21/99 Add regexec2.  Fix Windows build.
                    570:                Posted to Web page.
                    571: -----------------------------------------------------------------
                    572: v341    5/6/99  Add -F option; %c & ?c prompt escapes.
                    573:                (Thanks to Michele Maltoni)
                    574: v342   7/22/99  Add system-wide lesskey file; allow GPL or Less License.
                    575: v343   9/23/99 Support UTF-8 (Thanks to Robert Brady).
                    576:                Add %P and ?P in prompts.
                    577: v344  10/27/99 -w highlights target line of g and p commands.
                    578: v345  10/29/99 Make -R pass thru ESC but not other control chars.
                    579:                Posted to Web page.
                    580: -----------------------------------------------------------------
                    581: v346   11/4/99  Fix bugs in long option processing; R cmd should clear hilites.
                    582:                Posted to Web page.
                    583: -----------------------------------------------------------------
                    584: v347  12/13/99 Fixes for DJGPP version (thanks to Eli Zaretskii).
                    585: v348  12/28/99 Fix deleting file with marks (thanks to Dimitar Jekov).
                    586:                Fix color problem in DJGPP version (thanks to Eli Zaretskii).
                    587: v349   1/24/00 Fix minor DJGPP bugs; check environment vars for UTF-8;
                    588:                add --with-editor (thanks to Eli, Markus Kuhn, Thomas Schoepf).
                    589: v350   3/1/00  Fix clear-while-standout bug.
                    590: v351   3/5/00  Change -M and = prompts to show top & bottom line number.
                    591:                Posted to Web page.
                    592: -----------------------------------------------------------------
                    593: v352   3/8/00  Fix scan_option NULL dereference.
                    594: -----------------------------------------------------------------
                    595: v353   3/20/00 Fix SECURE compile bug, allow space after numeric option.
                    596: v354   3/23/00 Add support for PCRE; add --with-regex configure option.
                    597: -----------------------------------------------------------------
                    598: v355   6/28/00 Add -# option (thanks to Andy Levinson).
                    599: v356   7/5/00  Add -J option.
                    600: v357   7/6/00  Support sigprocmask.
                    601: -----------------------------------------------------------------
                    602: v358   7/8/00  Fix problems with #stop in lesskey file.
                    603:                Posted to Web page.
                    604: -----------------------------------------------------------------
                    605: v359  9/10/00  Fixes for Win32 display problems (thanks to Maurizio Vairani).
                    606: v360  1/17/01  Move sysless to etc.
                    607: v361  12/4/01  Add IBM-1047 charset & EBCDIC fixes (thanks to Thomas Dorner).
                    608:                Fix 32 bit dependencies (thanks to Paul Eggert).
                    609:                Fix UTF-8 overstriking (thanks to Robert Brady).
                    610: v362  12/4/01  Make status column show search targets.
                    611: v363  12/6/01  Add --no-keypad option.
                    612:                Add variable width tabstops (thanks to Peter Samuelson).
                    613: v364 12/10/01  Better handling of very long lines in input;
                    614:                Fix horizontal shifting of colored text.
                    615: v365 12/11/01  Fix overstriking of tabs;
                    616:                Add support for global(1) and multiple tag matches
                    617:                (thanks to Shigio Yamaguchi and Tim Vanderhoek).
                    618: v366 12/11/01  Fixes for OS/2 (thanks to Kyosuke Tokoro).
                    619: v367 12/13/01  Allow -D and -x options to terminate without dollar sign;
                    620:                Right/left arrow when entering N are shift cmds, not line edit.
                    621: v368 12/18/01  Update lesskey commands.
                    622: v370 12/23/01  Fix tags error messages.
                    623:                Posted to Web page.
                    624: -----------------------------------------------------------------
                    625: v371 12/26/01  Fix new_file bug; use popen in Windows version;
                    626:                fix some compiler warnings.
                    627: v372 12/29/01  Make -b be in units of 1K.
                    628: v373  1/14/02  Improve handling of filenames containing shell metachars.
                    629: v374   2/7/02  Fix memory leak; fix bug in -x argument parsing.
                    630: v375   4/7/02  Fix searching for SGR sequences; fix SECURE build;
                    631:                add SGR support to DJGPP version (thanks to Eli Zaretskii).
                    632: v376  6/10/02  Fix bug in overstriking mulitbyte UTF-8 characters
                    633:                (thanks to Jungshik Shin).
                    634:                Posted to Web page.
                    635: -----------------------------------------------------------------
                    636: v377  9/10/02  Fix bug in Windows version when file contains CR;
                    637:                fix bug in search highlights with -R;
                    638:                make initial buffer limit really be 64K not unlimited.
                    639: v378  9/30/02  Misc bug fixes and compiler warning cleanup.
                    640:                Posted to Web page.
                    641: -----------------------------------------------------------------
                    642: v379 11/23/02  Add -L option; fix bug with ctrl-K in lesskey files;
                    643:                improve UTF-8 overstriking and underscore overstriking;
                    644:                fix minor man page problems; change to autoconf 2.54.
                    645: v380 11/24/02  Make LINENUM same as POSITION.
                    646: v381 11/28/02  Make -N use 7 columns for line number if possible.
1.5     ! mbalmer   647: -----------------------------------------------------------------
        !           648: v382   2/3/04  Remove copyrighted code.
1.1       etheisen  649: */
                    650:
1.5     ! mbalmer   651: char version[] = "382";