summaryrefslogtreecommitdiff
path: root/usr.bin/less
diff options
context:
space:
mode:
authorMarc Balmer <mbalmer@cvs.openbsd.org>2007-04-19 05:56:46 +0000
committerMarc Balmer <mbalmer@cvs.openbsd.org>2007-04-19 05:56:46 +0000
commitd8945aab26f8ada9470b103c9eba2cbe149eac58 (patch)
treecab2b03a9efd2987642e782a480ea520e27efd97 /usr.bin/less
parent6b2fa77f962940b54f37a1070618e91aacb608e8 (diff)
Update to less version 382. This removes some code that is licensed under
a non-BSD license and which was not used on OpenBSD. No functional changes. From Daniel Dickmann <didickman@gmail.com>, ok itojun, millert, ray, matthieu
Diffstat (limited to 'usr.bin/less')
-rw-r--r--usr.bin/less/NEWS347
-rw-r--r--usr.bin/less/README204
-rw-r--r--usr.bin/less/lsystem.c140
-rw-r--r--usr.bin/less/version.c4
4 files changed, 506 insertions, 189 deletions
diff --git a/usr.bin/less/NEWS b/usr.bin/less/NEWS
index f928d95a5e8..6019cad3b73 100644
--- a/usr.bin/less/NEWS
+++ b/usr.bin/less/NEWS
@@ -1,3 +1,350 @@
+
+ NEWS about less
+
+======================================================================
+
+ For the latest news about less, see the "less" Web page:
+ http://www.greenwoodsoftware.com/less
+ You can also download the latest version of less from there.
+
+ To report bugs, suggestions or comments, send email to
+ bug-less@gnu.org or markn@greenwoodsoftware.com.
+
+======================================================================
+
+
+ Major changes between "less" versions 381 and 382
+
+* Removed some old copyrighted code.
+ This probably breaks OS/9 support.
+
+======================================================================
+
+ Major changes between "less" versions 378 and 381
+
+* New -L option to disable LESSOPEN processing.
+
+* Further support for large (64 bit) file addressing.
+ Large file support is now set up by the configure script.
+
+* Use autoconf 2.54.
+ Replace configure.in, acconfig.h, defines.h.top with configure.ac.
+
+* Overstriking underscore with underscore is now bold or underlined
+ depending on context.
+
+* Use only 7 spaces for line numbers in -N mode, if possible.
+
+* Fix some bugs in handling overstriking in UTF-8 files.
+
+* Fix some nroff issues in the man page.
+
+======================================================================
+
+ Major changes between "less" versions 376 and 378
+
+* Bug fixes:
+ Default buffer space is now 64K as documented.
+ Search highlighting works properly when used with -R.
+ Windows version works properly when input file contains carriage returns.
+ Clean up some compiler warnings.
+
+======================================================================
+
+ Major changes between "less" versions 358 and 376
+
+* -x option can now specify multiple variable-width tab stops.
+
+* -X option no longer disables keypad initialization.
+ New option --no-keypad disables keypad initialization.
+
+* New commands t and T step through multiple tag matches.
+ Added support for "global(1)" tags
+ (see http://www.gnu.org/software/global/global.html).
+
+* New prompt style set by option -Pw defines the message printed
+ while waiting for data in the F command.
+
+* System-wide lesskey file now defaults to sysless in etc directory
+ instead of .sysless in bin directory.
+ Use "configure --sysconfdir=..." to change it.
+ (For backwards compatibility, .sysless in bin is still recognized.)
+
+* Pressing RightArrow or LeftArrow while entering a number now shifts
+ the display N columns rather than editing the number itself.
+
+* Status column (enabled with -J) now shows search results.
+
+* Windows version sets window title.
+
+* Default LESSCHARSET for MS-DOS versions is now "dos".
+
+* Searching works better with ANSI (SGR) escape sequences.
+ ANSI color escape sequences are now supported in the MS-DOS (DJGPP) version.
+
+* Improved performance in reading very large pipes.
+
+* Eliminated some dependencies on file offets being 32 bits.
+
+* Fixed problems when viewing files with very long lines.
+
+* Fixed overstriking in UTF-8 mode, and overstriking tabs.
+
+* Improved horizontal shifting of text using -R option with ANSI color.
+
+* Improved handling of filenames containing shell metacharacters.
+
+* Some fixes for EBCDIC systems.
+
+* Some fixes for OS/2 systems.
+
+======================================================================
+
+ Major changes between "less" versions 354 and 358
+
+* Add -J (--status-column) option to display a status column.
+
+* Add -# (--shift) option to set default horizontal shift distance.
+ Default horizontal shift distance is now one-half screen width.
+
+* Horizontal shifting does not shift line numbers if -N is in effect.
+
+* Horizontal shifting acts as though -S were set, to avoid confusion.
+
+======================================================================
+
+
+ Major changes between "less" versions 352 and 354
+
+* Allow space after numeric-valued command line options.
+
+* Fix problem with configuring terminal libraries on some systems.
+
+* Add support for PCRE regular expression library.
+
+* Add --with-regex option to configure to allow manually selecting
+ a regular expression library.
+
+* Fix bug compiling with SECURE = 1.
+
+======================================================================
+
+
+ Major changes between "less" versions 346 and 352
+
+* Enable UTF-8 if "UTF-8" appears in locale-related environment variables.
+
+* Add --with-editor option to configure script.
+
+* The -M prompt and = message now show the top and bottom line number.
+
+* Fix bug in running the editor on a file whose name contains quotes, etc.
+
+* Fix bug in horizontal scrolling of long lines.
+
+* Fix bug in doing :d on a file which contains marks.
+
+* Fix bug causing cleared lines to sometimes be filled with standout,
+ bold, underline, etc. on certain terminals.
+
+* Fixes for MS-DOS (DJGPP) version.
+
+======================================================================
+
+
+ Major changes between "less" versions 340 and 346
+
+* The UTF-8 character set is now supported.
+
+* The default character set is now latin1 rather than ascii.
+
+* New option -R (--RAW-CONTROL-CHARS) is like -r but handles
+ long (wrapped) lines correctly, as long as the input contains only
+ normal text and ANSI color escape sequences.
+
+* New option -F (--quit-if-one-screen) quits if the text fits on
+ the first screen.
+
+* The -w option now highlights the target line of a g or p command.
+
+* A system-wide lesskey file is supported (LESSKEY_SYSTEM).
+
+* New escape for prompt strings: %c is replaced by column number.
+
+* New escape for prompt strings: %P is replaced by percentage into
+ file, based on line number rather than byte offset.
+
+* HOME and END keys now jump to beginning of file or end of file.
+
+======================================================================
+
+
+ Major changes between "less" versions 337 and 340
+
+* Command line options for less may now be given in either the old
+ single-letter form, or a new long name form (--option-name).
+ See the less man page or "less --help" for the list of long option names.
+
+* Command line options for lesskey may now be given in a new long name
+ form. See the lesskey man page for the list of long option names.
+
+* New command -- toggles an option using the long option name.
+
+* New command __ queries an option using the long option name.
+
+* The old -- command is renamed as -!.
+
+* If a ^P is entered between the dash and the option letter of the -
+ command, the message describing the new setting is suppressed.
+
+* Lesskey files may now contain \k escape sequences to represent the
+ "special" keys (arrows, PAGE-UP/PAGE-DOWN, HOME, END, INSERT, DELETE).
+
+* New command :d removes the current file from the list of files.
+
+* New option -~ (like -w before version 335)
+ suppresses tildes after end-of-file.
+
+* Less is now released under the GNU General Public License.
+
+======================================================================
+
+
+ Major changes between "less" versions 335 and 337
+
+* Fixed bugs in "make install".
+
+======================================================================
+
+
+ Major changes between "less" versions 332 and 335
+
+* The old -w flag (suppress tildes after end-of-file) has been removed.
+
+* New -w flag highlights the first new line after a forward-screen.
+
+* New -W flag highlights the first new line after any forward movement.
+
+* Window resize works even if LINES and/or COLUMNS environment
+ variables are incorrect.
+
+* New percent escapes for prompt strings:
+ %d is replaced by the page number, and
+ %D is replaced by the number of pages in the file.
+
+* Added charsets "iso8859" and "ebcdic".
+
+* In Windows version, uses HOMEDRIVE and HOMEPATH if HOME is not defined.
+
+* Fixed some bugs causing incorrect display on DOS/Windows.
+
+======================================================================
+
+
+ Major changes between "less" versions 330 and 332
+
+* Filenames from the command line are entered into the command history,
+ so UPARROW/DOWNARROW can be used to retrieve them from the :e command.
+
+* Now works correctly on Windows when using a scrolling terminal
+ window (buffer larger than display window).
+
+* On Windows, now restores the console screen on exit.
+ Use -X to get the old behavior.
+
+* Fixed bug on Windows when CAPS-LOCK or NUM-LOCK is pressed.
+
+* Fixed bug on Windows when piping output of an interactive program.
+
+* Fixed bug in tags file processing when tags file has DOS-style
+ line terminators (CR/LF).
+
+* Fixed compilation problem on OS/2.
+
+======================================================================
+
+
+ Major changes between "less" versions 321 and 330
+
+* Now supports filenames containing spaces (in double quotes).
+ New option -" can be used to change the quoting characters.
+
+* In filename completion, a slash is appended to a directory name.
+ If the environment variable LESSSEPARATOR is set, the value of
+ that variable, rather than a slash, is appended.
+
+* LeftArrow and RightArrow are same as ESC-[ and ESC-].
+
+* Added commands ESC-( and ESC-), same as ESC-[ and ESC-].
+
+* A "quit" command defined in a lesskey file may now have an "extra"
+ string, which is used to return an exit code from less when it quits.
+
+* New environment variables LESSMETACHARS and LESSMETAESCAPE provide
+ more control over how less interfaces to the shell.
+
+* Ported to Microsoft Visual C compiler for Windows.
+
+* Ported to DJGPP compiler for MS-DOS.
+
+* Bug fixes.
+
+======================================================================
+
+
+ Major changes between "less" versions 291 and 321
+
+* Command line at bottom of screen now scrolls, so it can be longer
+ than the screen width.
+
+* New commands ESC-] and ESC-[ scroll the display horizontally.
+
+* New command ESC-SPACE scrolls forward a full screen, even if it
+ hits end-of-file.
+
+* Alternate modifiers for search commands: ^N is same as !,
+ ^F is same as @, and ^E is same as *.
+
+* New modifier for search commands: ^K means highlight the matches
+ currently on-screen, but don't move to the first match.
+
+* New modifier for search commands: ^R means don't use regular
+ expressions in the search.
+
+* Environment variable LESSKEY gives name of default lesskey file.
+
+* Environment variable LESSSECURE will force less to run in
+ "secure" mode.
+
+* Command line argument "--" signals that the rest of the arguments
+ are files (not option flags).
+
+* Help file (less.hlp) is no longer installed. Help text is now
+ embedded in the less executable itself.
+
+* Added -Ph to change the prompt for the help text.
+ Added -Ps to change the default short prompt (same as plain -P).
+
+* Ported to the Borland C compiler for MS-DOS.
+
+* Ported to Windows 95 & Windows NT.
+
+* Ported to OS-9.
+
+* Ported to GNU Hurd.
+
+======================================================================
+
+
+ Major changes between "less" versions 290 and 291
+
+* Less environment variables can be specified in lesskey files.
+
+* Fixed MS-DOS build.
+
+======================================================================
+
+
Major changes between "less" versions 278 and 290
* Accepts GNU-style options "--help" and "--version".
diff --git a/usr.bin/less/README b/usr.bin/less/README
index 0419a52f6e7..cf7806f9a22 100644
--- a/usr.bin/less/README
+++ b/usr.bin/less/README
@@ -1,9 +1,31 @@
-=======================================================================
-=== NOTE: THIS IS A DISTRIBUTION OF less (version 290) ===
-=== PLEASE REPORT ANY PROBLEMS TO THE AUTHOR AT markn@3do.com. ===
-=======================================================================
+
+ Less, version 382
+
+ This is the distribution of less, version 382, released 03 Feb 2004.
+ This program is part of the GNU project (http://www.gnu.org).
+
+ This program is free software. You may redistribute it and/or
+ modify it under the terms of either:
+
+ 1. The GNU General Public License, as published by the Free
+ Software Foundation; either version 2, or (at your option) any
+ later version. A copy of this license is in the file COPYING.
+ or
+ 2. The Less License, in the file LICENSE.
+
+ Please report any problems to bug-less@gnu.org or markn@greenwoodsoftware.com.
+ See http://www.greenwoodsoftware.com/less for the latest info.
+ You may also contact the author at:
+ Mark Nudelman
+ Greenwood Software
+ PO Box 2402
+ El Granada, CA 94018
+ USA
+
+=========================================================================
This is the distribution of "less", a paginator similar to "more" or "pg".
+
The formatted manual page is in less.man.
The manual page nroff source is in less.nro.
Major changes made since the last posted version are in NEWS.
@@ -11,18 +33,38 @@ Major changes made since the last posted version are in NEWS.
=======================================================================
INSTALLATION (Unix systems only):
-1. Move the distributed source to its own directory and
- unpack it by running "sh" or "unshar" on the distribution
- files, if you have not already done so.
+1. Move the distributed source to its own directory and unpack it,
+ if you have not already done so.
2. Type "sh configure".
This will generate a Makefile and a defines.h.
Warning: if you have a GNU sed, make sure it is version 2.05 or later.
+ The file INSTALL describes the usage of the configure program in
+ general. In addition, these options to configure are supported:
+
+ --with-editor=program
+ Specifies the default editor program used by the "v" command.
+ The default is "vi".
+ --with-regex=lib
+ Specifies the regular expression library used by less for pattern
+ matching. The default is "auto", which means the configure program
+ finds a regular expression library automatically. Other values are:
+ posix Use the POSIX-compatible regcomp.
+ pcre Use the PCRE library.
+ regcmp Use the regcmp library.
+ re_comp Use the re_comp library.
+ regcomp Use the V8-compatible regcomp.
+ regcomp-local Use Henry Spencer's V8-compatible regcomp
+ (source is supplied with less).
+
3. It is a good idea to look over the generated Makefile and defines.h
and make sure they look ok. If you know of any peculiarities of
your system that configure might not have detected, you may fix the
- Makefile now.
+ Makefile now. Take particular notice of the list of "terminal"
+ libraries in the LIBS definition in the Makefile; these may need
+ to be edited. The terminal libraries will be some subset of
+ -lncurses -lcurses -ltermcap -ltermlib
If you wish, you may edit defines.h to remove some optional features.
If you wish to build a "secure" version of less (which disables all
@@ -31,29 +73,25 @@ INSTALLATION (Unix systems only):
If you choose not to include some features in your version, you may
wish to edit the manual page "less.nro" and the help page "less.hlp"
to remove the descriptions of the features which you are removing.
+ If you edit less.hlp, you should run "make -f Makefile.aut help.c".
4. Type "make" and watch the fun.
- If you want less to find the help file in a directory other than
- the default (/usr/local/share), define "datadir" to that directory.
- For example: "make datadir=/usr/local/helpfiles"
-
-5. If the make succeeds, it will generate a program "less"
- in your current directory. Test the generated program.
+5. If the make succeeds, it will generate the programs "less",
+ "lesskey" and "lessecho" in your current directory. Test the
+ generated programs.
6. When satisfied that it works, if you wish to install it
in a public place, type "make install".
The default install destinations are:
- Executables (less, lesskey) in /usr/local/bin
- Data files (less.hlp) in /usr/local/share
- Documentation (less.nro, lesskey.nro) in /usr/local/man/man1
+ Executables (less, lesskey, lessecho) in /usr/local/bin
+ Documentation (less.nro, lesskey.nro) in /usr/local/man/man1
If you want to install any of these files elsewhere, define
- bindir, datadir, and/or mandir to the appropriate directories.
- datadir must be defined the same as in step 4.
+ bindir and/or mandir to the appropriate directories.
If you have any problems building or running "less", suggestions,
-complaints, etc., you may mail to the author at markn@3do.com
+complaints, etc., you may mail to the author at markn@greenwoodsoftware.com.
Note to hackers: comments noting possible improvements are enclosed
in double curly brackets {{ like this }}.
@@ -61,59 +99,91 @@ in double curly brackets {{ like this }}.
=======================================================================
-INSTALLATION (MS-DOS systems only)
+INSTALLATION (MS-DOS systems only,
+ with Microsoft C, Borland C, or DJGPP)
1. Move the distributed source to its own directory.
- Make sure the source has been converted to have CR-LF rather than
- LF as line terminators.
+ Depending on your compiler, you may need to convert the source
+ to have CR-LF rather than LF as line terminators.
-2. Rename MAKEFILE.DOS to MAKEFILE.
+2. If you are using Microsoft C, rename MAKEFILE.DSU to MAKEFILE.
+ If you are using Borland C, rename MAKEFILE.DSB to MAKEFILE.
+ If you are using DJGPP, rename MAKEFILE.DSG to MAKEFILE.
3. Look at MAKEFILE to make sure that the definitions for CC and LIBDIR
- are correct. CC should be the name of your Microsoft C compiler and
- LIBDIR should be the directory where the Microsoft C libraries
- reside. If these definitions need to be changed, you can either
- modify the definitions directly in MAKEFILE, or set your environment
- variables CC and/or LIBDIR to override the definitions in MAKEFILE.
-
-4. If you wish, you may edit DEFINES.DOS to remove some optional features.
+ are correct. CC should be the name of your C compiler and
+ LIBDIR should be the directory where the C libraries reside (for
+ Microsoft C only). If these definitions need to be changed, you can
+ either modify the definitions directly in MAKEFILE, or set your
+ environment variables CC and/or LIBDIR to override the definitions
+ in MAKEFILE.
+
+4. If you wish, you may edit DEFINES.DS to remove some optional features.
If you choose not to include some features in your version, you may
- wish to edit the manual page LESS.MAN and the help page LESS.HLP
+ wish to edit the manual page LESS.MAN and the help page HELP.C
to remove the descriptions of the features which you are removing.
-5. Type "make" and watch the fun.
- You may need to invoke "make -e", if your "make" requires the -e
- flag to import environment variables.
+5. Run your "make" program and watch the fun.
+ If your "make" requires a flag to import environment variables,
+ you should use that flag.
If your compiler runs out of memory, try running "make -n >cmds.bat"
and then run cmds.bat.
-6. If the make succeeds, it will generate a program "LESS.EXE"
- in your current directory. Test the generated program.
+6. If the make succeeds, it will generate the programs "LESS.EXE" and
+ "LESSKEY.EXE" in your current directory. Test the generated programs.
+
+7. When satisfied that it works, you may wish to install LESS.EXE and
+ LESSKEY.EXE in a directory which is included in your PATH.
+
+
+
+=======================================================================
+INSTALLATION (Windows-95, Windows-98 and Windows-NT systems only,
+ with Borland C or Microsoft Visual C++)
+
+1. Move the distributed source to its own directory.
+
+2. If you are using Borland C, rename Makefile.wnb to Makefile.
+ If you are using Microsoft Visual C++, rename Makefile.wnm to Makefile.
+
+3. Check the Makefile to make sure the definitions look ok.
+
+4. If you wish, you may edit defines.wn to remove some optional features.
+ If you choose not to include some features in your version, you may
+ wish to edit the manual page less.man and the help page help.c
+ to remove the descriptions of the features which you are removing.
+
+5. Type "make" and watch the fun.
+
+6. If the make succeeds, it will generate the programs "less.exe" and
+ "lesskey.exe" in your current directory. Test the generated programs.
-7. When satisfied that it works, you may wish to install LESS.EXE,
- LESSKEY.EXE and LESS.HLP in a directory which is included in
- your PATH.
+7. When satisfied that it works, if you wish to install it
+ in a public place, type "make install".
+ See step 6 of the Unix installation instructions for details
+ on how to change the default installation directories.
=======================================================================
-INSTALLATION (OS/2 systems only)
+INSTALLATION (OS/2 systems only,
+ with EMX C)
1. Move the distributed source to its own directory.
-2. Rename Makefile.os2 to Makefile.
+2. Rename Makefile.o2e to Makefile.
3. Check the Makefile to make sure the definitions look ok.
-4. If you wish, you may edit defines.os2 to remove some optional features.
+4. If you wish, you may edit defines.o2 to remove some optional features.
If you choose not to include some features in your version, you may
- wish to edit the manual page less.man and the help page less.hlp
+ wish to edit the manual page less.man and the help page help.c
to remove the descriptions of the features which you are removing.
5. Type "make" and watch the fun.
-6. If the make succeeds, it will generate a program "less.exe"
- in your current directory. Test the generated program.
+6. If the make succeeds, it will generate the programs "less.exe" and
+ "lesskey.exe" in your current directory. Test the generated programs.
7. Make sure you have the emx runtime installed. You need the emx DLLs
emx.dll and emxlibcs.dll and also the termcap database, termcap.dat.
@@ -122,6 +192,44 @@ INSTALLATION (OS/2 systems only)
variables.
8. When satisfied that it works, you may wish to install less.exe,
- lesskey.exe and less.hlp in a directory which is included in
- your PATH.
+ lesskey.exe and scrsize.exe in a directory which is included in
+ your PATH. scrsize.exe is required only if you use a terminal
+ emulator such as xterm or rxvt.
+
+
+=======================================================================
+INSTALLATION (OS-9 systems only,
+ with Microware C or Ultra C)
+
+1. Move the distributed source to its own directory.
+
+2. If you are using Microware C, rename Makefile.o9c to Makefile.
+ If you are using Ultra C, rename Makefile.o9u to Makefile.
+
+3. Check the Makefile to make sure the definitions look ok.
+
+4. If you wish, you may edit defines.o9 to remove some optional features.
+ If you choose not to include some features in your version, you may
+ wish to edit the manual page less.man and the help page help.c
+ to remove the descriptions of the features which you are removing.
+
+5. Type "dmake" and watch the fun.
+ The standard OS-9 "make" will probably not work. If you don't
+ have dmake, you can get a copy from os9archive.rtsi.com.
+
+6. If the make succeeds, it will generate the programs "less" and
+ "lesskey" in your current directory. Test the generated programs.
+
+7. When satisfied that it works, if you wish to install it
+ in a public place, type "dmake install".
+ See step 6 of the Unix installation instructions for details
+ on how to change the default installation directories.
+
+=======================================================================
+ACKNOWLEDGMENTS:
+ Some versions of the less distribution are packaged using
+ Info-ZIP's compression utility.
+ Info-ZIP's software is free and can be obtained as source
+ code or executables from various anonymous-ftp sites,
+ including ftp.uu.net:/pub/archiving/zip.
diff --git a/usr.bin/less/lsystem.c b/usr.bin/less/lsystem.c
index 44ec82c58e7..bfb9fe817ff 100644
--- a/usr.bin/less/lsystem.c
+++ b/usr.bin/less/lsystem.c
@@ -368,143 +368,3 @@ pipe_data(cmd, spos, epos)
}
#endif
-
-#ifdef _OSK
-/*
- * Popen, and Pclose, for OS-9.
- *
- * Based on code copyright (c) 1988 by Wolfgang Ocker, Puchheim,
- * Ulli Dessauer, Germering and
- * Reimer Mellin, Muenchen
- * (W-Germany)
- *
- * These functions can be copied and distributed freely for any
- * non-commercial purposes. It can only be incorporated into
- * commercial software with the written permission of the authors.
- *
- * TOP-specific code stripped out and adapted for less by M.Gregorie, 1996
- *
- * address: Wolfgang Ocker
- * Lochhauserstrasse 35a
- * D-8039 Puchheim
- * West Germany
- *
- * e-mail: weo@altger.UUCP, ud@altger.UUCP, ram@altger.UUCP
- * pyramid!tmpmbx!recco!weo
- * pyramid!tmpmbx!nitmar!ud
- * pyramid!tmpmbx!ramsys!ram
- *
- * Martin Gregorie
- * 10 Sadlers Mead
- * Harlow
- * Essex, CM18 6HG
- * U.K.
- *
- * gregorie@logica.com
- */
-#include <strings.h>
-#include <errno.h>
-extern char **environ;
-extern char *getenv();
-extern int os9forkc();
-static int pids[_NFILE] = { 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0 };
-/*
- * p o p e n
- */
-FILE *popen(name, mode)
- char *name;
- char *mode;
-{
- int fd, fd2, fdsav, pid;
- static char *argv[] = {NULL, NULL, NULL };
- static char cmd[200];
- static char cmd_path[200];
- char *cp;
- char *shell;
- FILE *r;
- if ((shell = getenv("SHELL")) == NULL)
- return(NULL);
- cp = name;
- while (*cp == ' ')
- cp++;
- strlcpy(cmd_path, cp, sizeof(cmd_path));
- if (cp = strchr(cmd_path, ' '))
- *cp++ = '\0';
- strlcpy(cmd, "ex ", sizeof(cmd));
- strlcat(cmd, cmd_path, sizeof(cmd));
- if (cp)
- {
- strlcat(cmd, " ", sizeof(cmd));
- strlcat(cmd, cp, sizeof(cmd));
- }
- argv[0] = shell;
- argv[1] = cmd;
- /*
- mode is "r" (stdout) or "w" (stdin)
- */
- switch(mode[0])
- {
- case 'w': fd = 0;
- break;
- case 'r': fd = 1;
- break;
- default: return(NULL);
- }
- if (fd == 1)
- fflush(stdout);
- fdsav = dup(fd);
- close(fd);
-
- creat("/pipe", S_IWRITE+S_IREAD);
- pid = os9exec(os9forkc, argv[0], argv, environ, 0, 0, 3);
- fd2 = dup(fd);
- close(fd);
- dup(fdsav);
- close(fdsav);
- if (pid > 0)
- {
- pids[fd2] = pid;
- r = fdopen(fd2, mode);
- }
- else
- {
- close(fd2);
- r = NULL;
- }
- return(r);
-}
-
-/*
- * p c l o s e
- */
-int pclose(fp)
- FILE *fp;
-{
- unsigned int status;
- int pid;
- int fd,
- i;
- fd = fileno(fp);
- if (pids[fd] == 0)
- return(-1);
- fflush(fp);
- fclose(fp);
- while ((pid = wait(&status)) != -1)
- if (pid == pids[fd])
- break;
- else
- for (i = 0; i < _NFILE; i++)
- if (pids[i] == pid)
- {
- pids[i] = 0;
- break;
- }
- if (pid == -1)
- status = -1;
- pids[fd] = 0;
- return(status);
-}
-#endif /* _OSK */
diff --git a/usr.bin/less/version.c b/usr.bin/less/version.c
index a048250474c..e9283ee21c2 100644
--- a/usr.bin/less/version.c
+++ b/usr.bin/less/version.c
@@ -644,6 +644,8 @@ v379 11/23/02 Add -L option; fix bug with ctrl-K in lesskey files;
fix minor man page problems; change to autoconf 2.54.
v380 11/24/02 Make LINENUM same as POSITION.
v381 11/28/02 Make -N use 7 columns for line number if possible.
+-----------------------------------------------------------------
+v382 2/3/04 Remove copyrighted code.
*/
-char version[] = "381";
+char version[] = "382";