svn commit: r195941 - in head: contrib/less usr.bin/less
Xin LI
delphij at FreeBSD.org
Wed Jul 29 09:20:33 UTC 2009
Author: delphij
Date: Wed Jul 29 09:20:32 2009
New Revision: 195941
URL: http://svn.freebsd.org/changeset/base/195941
Log:
Update less to v436. This is considered as a bugfix release from vendor.
Major changes from v429:
* Don't pass "-" to non-pipe LESSOPEN unless it starts with "-".
* Allow a fraction as the argument to the -# (--shift) option.
* Fix highlight bug when underlined/overstruck text matches at end of line.
* Fix non-regex searches with ctrl-R.
Approved by: re (kensmith, kib)
Added:
head/contrib/less/cvt.c
- copied unchanged from r195903, vendor/less/dist/cvt.c
head/contrib/less/pattern.c
- copied unchanged from r195903, vendor/less/dist/pattern.c
head/contrib/less/pattern.h
- copied, changed from r195903, vendor/less/dist/pattern.h
Modified:
head/contrib/less/ (props changed)
head/contrib/less/LICENSE
head/contrib/less/Makefile.aut
head/contrib/less/Makefile.dsb
head/contrib/less/Makefile.dsg
head/contrib/less/Makefile.dsu
head/contrib/less/Makefile.in
head/contrib/less/Makefile.o2e
head/contrib/less/Makefile.o9c
head/contrib/less/Makefile.o9u
head/contrib/less/Makefile.wnb
head/contrib/less/Makefile.wnm
head/contrib/less/NEWS
head/contrib/less/README
head/contrib/less/brac.c
head/contrib/less/ch.c
head/contrib/less/charset.c
head/contrib/less/charset.h
head/contrib/less/cmd.h
head/contrib/less/cmdbuf.c
head/contrib/less/command.c
head/contrib/less/configure.ac
head/contrib/less/decode.c
head/contrib/less/defines.ds
head/contrib/less/defines.o2
head/contrib/less/defines.o9
head/contrib/less/defines.wn
head/contrib/less/edit.c
head/contrib/less/filename.c
head/contrib/less/forwback.c
head/contrib/less/funcs.h
head/contrib/less/ifile.c
head/contrib/less/input.c
head/contrib/less/jump.c
head/contrib/less/less.h
head/contrib/less/less.man
head/contrib/less/less.nro
head/contrib/less/lessecho.c
head/contrib/less/lessecho.man
head/contrib/less/lessecho.nro
head/contrib/less/lesskey.c
head/contrib/less/lesskey.h
head/contrib/less/lesskey.man
head/contrib/less/lesskey.nro
head/contrib/less/lglob.h
head/contrib/less/line.c
head/contrib/less/linenum.c
head/contrib/less/lsystem.c
head/contrib/less/main.c
head/contrib/less/mark.c
head/contrib/less/mkhelp.c
head/contrib/less/optfunc.c
head/contrib/less/option.c
head/contrib/less/option.h
head/contrib/less/opttbl.c
head/contrib/less/os.c
head/contrib/less/output.c
head/contrib/less/pckeys.h
head/contrib/less/position.c
head/contrib/less/position.h
head/contrib/less/prompt.c
head/contrib/less/screen.c
head/contrib/less/scrsize.c
head/contrib/less/search.c
head/contrib/less/signal.c
head/contrib/less/tags.c
head/contrib/less/ttyin.c
head/contrib/less/version.c
head/usr.bin/less/Makefile
Modified: head/contrib/less/LICENSE
==============================================================================
--- head/contrib/less/LICENSE Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/LICENSE Wed Jul 29 09:20:32 2009 (r195941)
@@ -2,7 +2,7 @@
------------
Less
-Copyright (C) 1984-2008 Mark Nudelman
+Copyright (C) 1984-2009 Mark Nudelman
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
Modified: head/contrib/less/Makefile.aut
==============================================================================
--- head/contrib/less/Makefile.aut Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/Makefile.aut Wed Jul 29 09:20:32 2009 (r195941)
@@ -10,10 +10,10 @@ srcdir = .
SRC = \
main.c screen.c brac.c ch.c charset.c cmdbuf.c \
- command.c decode.c edit.c filename.c forwback.c \
+ command.c cvt.c decode.c edit.c filename.c forwback.c \
help.c ifile.c input.c jump.c line.c linenum.c \
lsystem.c mark.c optfunc.c option.c opttbl.c os.c \
- output.c position.c prompt.c search.c signal.c \
+ output.c pattern.c position.c prompt.c search.c signal.c \
tags.c ttyin.c version.c
DISTFILES_W = \
defines.ds Makefile.dsb Makefile.dsg Makefile.dsu \
@@ -24,7 +24,8 @@ DISTFILES = \
${SRC} regexp.c regexp.h \
COPYING INSTALL LICENSE Makefile.in Makefile.aut NEWS README \
configure configure.ac lesskey.c lessecho.c scrsize.c \
- charset.h cmd.h funcs.h lglob.h less.h lesskey.h option.h pckeys.h position.h \
+ charset.h cmd.h funcs.h lglob.h less.h lesskey.h option.h \
+ pckeys.h pattern.h position.h \
install.sh defines.h.in mkinstalldirs \
less.nro less.man lesskey.nro lesskey.man lessecho.nro lessecho.man \
less.hlp \
@@ -109,6 +110,8 @@ dist: ${DISTFILES}
cd $$REL; chmod +w ${DISTFILES_W}; cd ..; \
echo "Creating release/$$REL/$$REL.tar.gz"; \
tar -cf - $$REL | gzip -c >release/$$REL/$$REL.tar.gz; \
+ echo "Signing release/$$REL/$$REL.tar.gz"; \
+ gpg --detach-sign release/$$REL/$$REL.tar.gz; \
echo "Creating release/$$REL/$$REL.zip"; \
zip -rq release/$$REL/$$REL.zip $$REL; \
rm -rf $$REL
Modified: head/contrib/less/Makefile.dsb
==============================================================================
--- head/contrib/less/Makefile.dsb Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/Makefile.dsb Wed Jul 29 09:20:32 2009 (r195941)
@@ -18,12 +18,13 @@ EXT = .EXE
.c.obj:
$(CC) -c -I. $(CPPFLAGS) $(CFLAGS) $<
-OBJ = main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj command.obj \
- decode.obj edit.obj filename.obj forwback.obj help.obj ifile.obj \
- input.obj jump.obj line.obj linenum.obj lsystem.obj \
- mark.obj optfunc.obj option.obj opttbl.obj os.obj output.obj \
- position.obj prompt.obj search.obj signal.obj tags.obj \
- ttyin.obj version.obj
+OBJ = \
+ main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj \
+ command.obj cvt.obj decode.obj edit.obj filename.obj forwback.obj \
+ help.obj ifile.obj input.obj jump.obj line.obj linenum.obj \
+ lsystem.obj mark.obj optfunc.obj option.obj opttbl.obj os.obj \
+ output.obj pattern.obj position.obj prompt.obj search.obj signal.obj \
+ tags.obj ttyin.obj version.obj
all: less$(EXT) lesskey$(EXT)
Modified: head/contrib/less/Makefile.dsg
==============================================================================
--- head/contrib/less/Makefile.dsg Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/Makefile.dsg Wed Jul 29 09:20:32 2009 (r195941)
@@ -33,11 +33,12 @@ manext = 1
.c.o:
${CC} -I. ${CFLAGS_COMPILE_ONLY} -DBINDIR=\"${bindir}\" -DSYSDIR=\"${sysconfdir}\" ${CPPFLAGS} ${CFLAGS} $<
-OBJ = main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \
- command.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \
+OBJ = \
+ main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \
+ command.${O} cvt.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \
help.${O} ifile.${O} input.${O} jump.${O} line.${O} linenum.${O} \
lsystem.${O} mark.${O} optfunc.${O} option.${O} opttbl.${O} os.${O} \
- output.${O} position.${O} prompt.${O} search.${O} signal.${O} \
+ output.${O} pattern.${O} position.${O} prompt.${O} search.${O} signal.${O} \
tags.${O} ttyin.${O} version.${O}
all: less lesskey lessecho
Modified: head/contrib/less/Makefile.dsu
==============================================================================
--- head/contrib/less/Makefile.dsu Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/Makefile.dsu Wed Jul 29 09:20:32 2009 (r195941)
@@ -27,12 +27,13 @@ LIBS = $(LIBDIR)\llibce.lib $(LIBDIR)\gr
.c.obj:
$(CC) -c -I. -I$(INCDIR) $(CPPFLAGS) $(CFLAGS) $<
-OBJ = main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj command.obj \
- decode.obj edit.obj filename.obj forwback.obj help.obj ifile.obj \
- input.obj jump.obj line.obj linenum.obj lsystem.obj \
- mark.obj optfunc.obj option.obj opttbl.obj os.obj output.obj \
- position.obj prompt.obj search.obj signal.obj tags.obj \
- ttyin.obj version.obj
+OBJ = \
+ main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj \
+ command.obj cvt.obj decode.obj edit.obj filename.obj forwback.obj \
+ help.obj ifile.obj input.obj jump.obj line.obj linenum.obj \
+ lsystem.obj mark.obj optfunc.obj option.obj opttbl.obj os.obj \
+ output.obj pattern.obj position.obj prompt.obj search.obj signal.obj \
+ tags.obj ttyin.obj version.obj
all: less lesskey
Modified: head/contrib/less/Makefile.in
==============================================================================
--- head/contrib/less/Makefile.in Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/Makefile.in Wed Jul 29 09:20:32 2009 (r195941)
@@ -43,11 +43,12 @@ SHELL = /bin/sh
.c.o:
${CC} -I. ${CFLAGS_COMPILE_ONLY} -DBINDIR=\"${bindir}\" -DSYSDIR=\"${sysconfdir}\" ${CPPFLAGS} ${CFLAGS} $<
-OBJ = main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \
- command.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \
+OBJ = \
+ main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \
+ command.${O} cvt.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \
help.${O} ifile.${O} input.${O} jump.${O} line.${O} linenum.${O} \
lsystem.${O} mark.${O} optfunc.${O} option.${O} opttbl.${O} os.${O} \
- output.${O} position.${O} prompt.${O} search.${O} signal.${O} \
+ output.${O} pattern.${O} position.${O} prompt.${O} search.${O} signal.${O} \
tags.${O} ttyin.${O} version.${O} @REGEX_O@
all: less$(EXEEXT) lesskey$(EXEEXT) lessecho$(EXEEXT)
Modified: head/contrib/less/Makefile.o2e
==============================================================================
--- head/contrib/less/Makefile.o2e Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/Makefile.o2e Wed Jul 29 09:20:32 2009 (r195941)
@@ -18,11 +18,12 @@ O = obj
.c.${O}:
${CC} -c ${CPPFLAGS} ${CFLAGS} $<
-OBJ = main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \
- command.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \
+OBJ = \
+ main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \
+ command.${O} cvt.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \
help.${O} ifile.${O} input.${O} jump.${O} line.${O} linenum.${O} \
lsystem.${O} mark.${O} optfunc.${O} option.${O} opttbl.${O} os.${O} \
- output.${O} position.${O} prompt.${O} search.${O} signal.${O} \
+ output.${O} pattern.${O} position.${O} prompt.${O} search.${O} signal.${O} \
tags.${O} ttyin.${O} version.${O} regexp.${O}
all: less.exe lesskey.exe scrsize.exe
Modified: head/contrib/less/Makefile.o9c
==============================================================================
--- head/contrib/less/Makefile.o9c Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/Makefile.o9c Wed Jul 29 09:20:32 2009 (r195941)
@@ -22,11 +22,12 @@ O = r
.c.${O}:
${CC} ${CFLAGS_COMPILE_ONLY} ${CPPFLAGS} ${CFLAGS} $<
-OBJ = main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \
- command.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \
+OBJ = \
+ main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \
+ command.${O} cvt.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \
help.${O} ifile.${O} input.${O} jump.${O} line.${O} linenum.${O} \
lsystem.${O} mark.${O} optfunc.${O} option.${O} opttbl.${O} os.${O} \
- output.${O} position.${O} prompt.${O} search.${O} signal.${O} \
+ output.${O} pattern.${O} position.${O} prompt.${O} search.${O} signal.${O} \
tags.${O} ttyin.${O} version.${O} regexp.${O}
all: less lessecho lesskey
Modified: head/contrib/less/Makefile.o9u
==============================================================================
--- head/contrib/less/Makefile.o9u Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/Makefile.o9u Wed Jul 29 09:20:32 2009 (r195941)
@@ -21,11 +21,12 @@ O = r
.c.${O}:
${CC} ${CFLAGS_COMPILE_ONLY} ${CPPFLAGS} ${CFLAGS} $<
-OBJ = main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \
- command.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \
+OBJ = \
+ main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \
+ command.${O} cvt.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \
help.${O} ifile.${O} input.${O} jump.${O} line.${O} linenum.${O} \
lsystem.${O} mark.${O} optfunc.${O} option.${O} opttbl.${O} os.${O} \
- output.${O} position.${O} prompt.${O} search.${O} signal.${O} \
+ output.${O} pattern.${O} position.${O} prompt.${O} search.${O} signal.${O} \
tags.${O} ttyin.${O} version.${O} regexp.${O}
all: less lesskey
Modified: head/contrib/less/Makefile.wnb
==============================================================================
--- head/contrib/less/Makefile.wnb Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/Makefile.wnb Wed Jul 29 09:20:32 2009 (r195941)
@@ -25,12 +25,13 @@ LIBS = ${LIBDIR}\import32.lib ${LIBDIR}\
.c.obj:
${CC} -c -I. ${CPPFLAGS} ${CFLAGS} $<
-OBJ = main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj command.obj \
- decode.obj edit.obj filename.obj forwback.obj help.obj ifile.obj \
- input.obj jump.obj line.obj linenum.obj lsystem.obj \
- mark.obj optfunc.obj option.obj opttbl.obj os.obj output.obj \
- position.obj prompt.obj search.obj signal.obj tags.obj \
- ttyin.obj version.obj regexp.obj
+OBJ = \
+ main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj \
+ command.obj cvt.obj decode.obj edit.obj filename.obj forwback.obj \
+ help.obj ifile.obj input.obj jump.obj line.obj linenum.obj \
+ lsystem.obj mark.obj optfunc.obj option.obj opttbl.obj os.obj \
+ output.obj pattern.obj position.obj prompt.obj search.obj signal.obj \
+ tags.obj ttyin.obj version.obj regexp.obj
all: less lesskey lessecho
Modified: head/contrib/less/Makefile.wnm
==============================================================================
--- head/contrib/less/Makefile.wnm Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/Makefile.wnm Wed Jul 29 09:20:32 2009 (r195941)
@@ -23,12 +23,13 @@ LIBS = user32.lib
.c.obj:
$(CC) $(CFLAGS) $<
-OBJ = main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj command.obj \
- decode.obj edit.obj filename.obj forwback.obj help.obj ifile.obj \
- input.obj jump.obj line.obj linenum.obj lsystem.obj \
- mark.obj optfunc.obj option.obj opttbl.obj os.obj output.obj \
- position.obj prompt.obj search.obj signal.obj tags.obj \
- ttyin.obj version.obj regexp.obj
+OBJ = \
+ main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj \
+ command.obj cvt.obj decode.obj edit.obj filename.obj forwback.obj \
+ help.obj ifile.obj input.obj jump.obj line.obj linenum.obj \
+ lsystem.obj mark.obj optfunc.obj option.obj opttbl.obj os.obj \
+ output.obj pattern.obj position.obj prompt.obj search.obj signal.obj \
+ tags.obj ttyin.obj version.obj regexp.obj
all: less.exe lesskey.exe
Modified: head/contrib/less/NEWS
==============================================================================
--- head/contrib/less/NEWS Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/NEWS Wed Jul 29 09:20:32 2009 (r195941)
@@ -12,6 +12,18 @@
======================================================================
+ Major changes between "less" versions 429 and 436
+
+* Don't pass "-" to non-pipe LESSOPEN unless it starts with "-".
+
+* Allow a fraction as the argument to the -# (--shift) option.
+
+* Fix highlight bug when underlined/overstruck text matches at end of line.
+
+* Fix non-regex searches with ctrl-R.
+
+======================================================================
+
Major changes between "less" versions 424 and 429
* LESSOPEN pipe will now be used on standard input, if the LESSOPEN
Modified: head/contrib/less/README
==============================================================================
--- head/contrib/less/README Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/README Wed Jul 29 09:20:32 2009 (r195941)
@@ -1,7 +1,7 @@
- Less, version 429
+ Less, version 436
- This is the distribution of less, version 429, released 11 Apr 2009.
+ This is the distribution of less, version 436, released 07 Jul 2009.
This program is part of the GNU project (http://www.gnu.org).
This program is free software. You may redistribute it and/or
Modified: head/contrib/less/brac.c
==============================================================================
--- head/contrib/less/brac.c Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/brac.c Wed Jul 29 09:20:32 2009 (r195941)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2008 Mark Nudelman
+ * Copyright (C) 1984-2009 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
Modified: head/contrib/less/ch.c
==============================================================================
--- head/contrib/less/ch.c Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/ch.c Wed Jul 29 09:20:32 2009 (r195941)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2008 Mark Nudelman
+ * Copyright (C) 1984-2009 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
Modified: head/contrib/less/charset.c
==============================================================================
--- head/contrib/less/charset.c Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/charset.c Wed Jul 29 09:20:32 2009 (r195941)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2008 Mark Nudelman
+ * Copyright (C) 1984-2009 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -425,7 +425,7 @@ prchar(c)
c &= 0377;
if ((c < 128 || !utf_mode) && !control_char(c))
- SNPRINTF1(buf, sizeof(buf), "%c", c);
+ SNPRINTF1(buf, sizeof(buf), "%c", (int) c);
else if (c == ESC)
strcpy(buf, "ESC");
#if IS_EBCDIC_HOST
@@ -442,7 +442,7 @@ prchar(c)
"..V....D....TU.Z"[c]);
#else
else if (c < 128 && !control_char(c ^ 0100))
- SNPRINTF1(buf, sizeof(buf), "^%c", c ^ 0100);
+ SNPRINTF1(buf, sizeof(buf), "^%c", (int) (c ^ 0100));
#endif
else
SNPRINTF1(buf, sizeof(buf), binfmt, c);
Modified: head/contrib/less/charset.h
==============================================================================
--- head/contrib/less/charset.h Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/charset.h Wed Jul 29 09:20:32 2009 (r195941)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2008 Mark Nudelman
+ * Copyright (C) 2005-2009 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
Modified: head/contrib/less/cmd.h
==============================================================================
--- head/contrib/less/cmd.h Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/cmd.h Wed Jul 29 09:20:32 2009 (r195941)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2008 Mark Nudelman
+ * Copyright (C) 1984-2009 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
Modified: head/contrib/less/cmdbuf.c
==============================================================================
--- head/contrib/less/cmdbuf.c Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/cmdbuf.c Wed Jul 29 09:20:32 2009 (r195941)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2008 Mark Nudelman
+ * Copyright (C) 1984-2009 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
Modified: head/contrib/less/command.c
==============================================================================
--- head/contrib/less/command.c Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/command.c Wed Jul 29 09:20:32 2009 (r195941)
@@ -1,6 +1,6 @@
/* $FreeBSD$ */
/*
- * Copyright (C) 1984-2008 Mark Nudelman
+ * Copyright (C) 1984-2009 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
Modified: head/contrib/less/configure.ac
==============================================================================
--- head/contrib/less/configure.ac Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/configure.ac Wed Jul 29 09:20:32 2009 (r195941)
@@ -1,6 +1,6 @@
# Process this file with autoconf to produce a configure script.
-# Copyright (C) 1984-2008 Mark Nudelman
+# Copyright (C) 1984-2009 Mark Nudelman
#
# You may distribute under the terms of either the GNU General Public
# License or the Less License, as specified in the README file.
Copied: head/contrib/less/cvt.c (from r195903, vendor/less/dist/cvt.c)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/contrib/less/cvt.c Wed Jul 29 09:20:32 2009 (r195941, copy of r195903, vendor/less/dist/cvt.c)
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 1984-2009 Mark Nudelman
+ *
+ * You may distribute under the terms of either the GNU General Public
+ * License or the Less License, as specified in the README file.
+ *
+ * For more information about less, or for information on how to
+ * contact the author, see the README file.
+ */
+
+/*
+ * Routines to convert text in various ways. Used by search.
+ */
+
+#include "less.h"
+#include "charset.h"
+
+extern int utf_mode;
+
+/*
+ * Get the length of a buffer needed to convert a string.
+ */
+ public int
+cvt_length(len, ops)
+ int len;
+ int ops;
+{
+ if (utf_mode)
+ /*
+ * Just copying a string in UTF-8 mode can cause it to grow
+ * in length.
+ * Four output bytes for one input byte is the worst case.
+ */
+ len *= 4;
+ return (len + 1);
+}
+
+/*
+ * Allocate a chpos array for use by cvt_text.
+ */
+ public int *
+cvt_alloc_chpos(len)
+ int len;
+{
+ int i;
+ int *chpos = (int *) ecalloc(sizeof(int), len);
+ /* Initialize all entries to an invalid position. */
+ for (i = 0; i < len; i++)
+ chpos[i] = -1;
+ return (chpos);
+}
+
+/*
+ * Convert text. Perform the transformations specified by ops.
+ * Returns converted text in odst. The original offset of each
+ * odst character (when it was in osrc) is returned in the chpos array.
+ */
+ public void
+cvt_text(odst, osrc, chpos, lenp, ops)
+ char *odst;
+ char *osrc;
+ int *chpos;
+ int *lenp;
+ int ops;
+{
+ char *dst;
+ char *src;
+ register char *src_end;
+ LWCHAR ch;
+
+ if (lenp != NULL)
+ src_end = osrc + *lenp;
+ else
+ src_end = osrc + strlen(osrc);
+
+ for (src = osrc, dst = odst; src < src_end; )
+ {
+ int src_pos = src - osrc;
+ int dst_pos = dst - odst;
+ ch = step_char(&src, +1, src_end);
+ if ((ops & CVT_BS) && ch == '\b' && dst > odst)
+ {
+ /* Delete backspace and preceding char. */
+ do {
+ dst--;
+ } while (dst > odst &&
+ !IS_ASCII_OCTET(*dst) && !IS_UTF8_LEAD(*dst));
+ } else if ((ops & CVT_ANSI) && IS_CSI_START(ch))
+ {
+ /* Skip to end of ANSI escape sequence. */
+ src++; /* skip the CSI start char */
+ while (src < src_end)
+ if (!is_ansi_middle(*src++))
+ break;
+ } else
+ {
+ /* Just copy the char to the destination buffer. */
+ if ((ops & CVT_TO_LC) && IS_UPPER(ch))
+ ch = TO_LOWER(ch);
+ put_wchar(&dst, ch);
+ /*
+ * Record the original position of the char.
+ * But if we've already recorded a position
+ * for this char (due to a backspace), leave
+ * it alone; if multiple source chars map to
+ * one destination char, we want the position
+ * of the first one.
+ */
+ if (chpos != NULL && chpos[dst_pos] < 0)
+ chpos[dst_pos] = src_pos;
+ }
+ }
+ if ((ops & CVT_CRLF) && dst > odst && dst[-1] == '\r')
+ dst--;
+ *dst = '\0';
+ if (lenp != NULL)
+ *lenp = dst - odst;
+ if (chpos != NULL)
+ chpos[dst - odst] = src - osrc;
+}
Modified: head/contrib/less/decode.c
==============================================================================
--- head/contrib/less/decode.c Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/decode.c Wed Jul 29 09:20:32 2009 (r195941)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2008 Mark Nudelman
+ * Copyright (C) 1984-2009 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
Modified: head/contrib/less/defines.ds
==============================================================================
--- head/contrib/less/defines.ds Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/defines.ds Wed Jul 29 09:20:32 2009 (r195941)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2008 Mark Nudelman
+ * Copyright (C) 1984-2009 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
Modified: head/contrib/less/defines.o2
==============================================================================
--- head/contrib/less/defines.o2 Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/defines.o2 Wed Jul 29 09:20:32 2009 (r195941)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2008 Mark Nudelman
+ * Copyright (C) 1984-2009 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
Modified: head/contrib/less/defines.o9
==============================================================================
--- head/contrib/less/defines.o9 Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/defines.o9 Wed Jul 29 09:20:32 2009 (r195941)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2008 Mark Nudelman
+ * Copyright (C) 1984-2009 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
Modified: head/contrib/less/defines.wn
==============================================================================
--- head/contrib/less/defines.wn Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/defines.wn Wed Jul 29 09:20:32 2009 (r195941)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2008 Mark Nudelman
+ * Copyright (C) 1984-2009 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
Modified: head/contrib/less/edit.c
==============================================================================
--- head/contrib/less/edit.c Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/edit.c Wed Jul 29 09:20:32 2009 (r195941)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2008 Mark Nudelman
+ * Copyright (C) 1984-2009 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
Modified: head/contrib/less/filename.c
==============================================================================
--- head/contrib/less/filename.c Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/filename.c Wed Jul 29 09:20:32 2009 (r195941)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2008 Mark Nudelman
+ * Copyright (C) 1984-2009 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -843,17 +843,17 @@ open_altfile(filename, pf, pfd)
#else
lessopen++;
returnfd = 1;
- if (*lessopen == '-') {
- /*
- * Lessopen preprocessor will accept "-" as a filename.
- */
- lessopen++;
- } else {
- if (strcmp(filename, "-") == 0)
- return (NULL);
- }
#endif
}
+ if (*lessopen == '-') {
+ /*
+ * Lessopen preprocessor will accept "-" as a filename.
+ */
+ lessopen++;
+ } else {
+ if (strcmp(filename, "-") == 0)
+ return (NULL);
+ }
len = strlen(lessopen) + strlen(filename) + 2;
cmd = (char *) ecalloc(len, sizeof(char));
Modified: head/contrib/less/forwback.c
==============================================================================
--- head/contrib/less/forwback.c Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/forwback.c Wed Jul 29 09:20:32 2009 (r195941)
@@ -1,6 +1,6 @@
/* $FreeBSD$ */
/*
- * Copyright (C) 1984-2008 Mark Nudelman
+ * Copyright (C) 1984-2009 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
Modified: head/contrib/less/funcs.h
==============================================================================
--- head/contrib/less/funcs.h Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/funcs.h Wed Jul 29 09:20:32 2009 (r195941)
@@ -83,6 +83,9 @@
public void ungetcc ();
public void ungetsc ();
public void commands ();
+ public int cvt_length ();
+ public int * cvt_alloc_chpos ();
+ public void cvt_text ();
public void init_cmds ();
public void add_fcmd_table ();
public void add_ecmd_table ();
@@ -193,6 +196,8 @@
public void opt_l ();
public void opt_j ();
public void calc_jump_sline ();
+ public void opt_shift ();
+ public void calc_shift_count ();
public void opt_k ();
public void opt_t ();
public void opt__T ();
@@ -233,6 +238,10 @@
public void error ();
public void ierror ();
public int query ();
+ public int compile_pattern ();
+ public void uncompile_pattern ();
+ public int is_null_pattern ();
+ public int match_pattern ();
public POSITION position ();
public void add_forw_pos ();
public void add_back_pos ();
@@ -248,6 +257,7 @@
public char * eq_message ();
public char * pr_string ();
public char * wait_message ();
+ public void init_search ();
public void repaint_hilite ();
public void clear_attn ();
public void undo_search ();
Modified: head/contrib/less/ifile.c
==============================================================================
--- head/contrib/less/ifile.c Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/ifile.c Wed Jul 29 09:20:32 2009 (r195941)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2008 Mark Nudelman
+ * Copyright (C) 1984-2009 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
Modified: head/contrib/less/input.c
==============================================================================
--- head/contrib/less/input.c Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/input.c Wed Jul 29 09:20:32 2009 (r195941)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2008 Mark Nudelman
+ * Copyright (C) 1984-2009 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -196,7 +196,7 @@ get_forw_line:
c = ch_forw_get();
}
- pdone(endline, c);
+ pdone(endline, 1);
#if HILITE_SEARCH
if (is_filtered(base_pos))
@@ -398,7 +398,7 @@ get_back_line:
}
} while (new_pos < curr_pos);
- pdone(endline, ch_forw_get());
+ pdone(endline, 0);
#if HILITE_SEARCH
if (is_filtered(base_pos))
Modified: head/contrib/less/jump.c
==============================================================================
--- head/contrib/less/jump.c Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/jump.c Wed Jul 29 09:20:32 2009 (r195941)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2008 Mark Nudelman
+ * Copyright (C) 1984-2009 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
Modified: head/contrib/less/less.h
==============================================================================
--- head/contrib/less/less.h Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/less.h Wed Jul 29 09:20:32 2009 (r195941)
@@ -1,6 +1,6 @@
/* $FreeBSD$ */
/*
- * Copyright (C) 1984-2008 Mark Nudelman
+ * Copyright (C) 1984-2009 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -489,6 +489,12 @@ struct textlist
#define FAKE_HELPFILE "@/\\less/\\help/\\file/\\@"
+/* Flags for cvt_text */
+#define CVT_TO_LC 01 /* Convert upper-case to lower-case */
+#define CVT_BS 02 /* Do backspace processing */
+#define CVT_CRLF 04 /* Remove CR after LF */
+#define CVT_ANSI 010 /* Remove ANSI escape sequences */
+
#include "funcs.h"
/* Functions not included in funcs.h */
Modified: head/contrib/less/less.man
==============================================================================
--- head/contrib/less/less.man Wed Jul 29 08:49:58 2009 (r195940)
+++ head/contrib/less/less.man Wed Jul 29 09:20:32 2009 (r195941)
@@ -809,51 +809,58 @@ LESS(1)
Specifies the default number of positions to scroll horizontally
in the RIGHTARROW and LEFTARROW commands. If the number speci-
fied is zero, it sets the default number of positions to one
- half of the screen width.
+ half of the screen width. Alternately, the number may be speci-
+ fied as a fraction of the width of the screen, starting with a
+ decimal point: .5 is half of the screen width, .3 is three
+ tenths of the screen width, and so on. If the number is speci-
+ fied as a fraction, the actual number of scroll positions is
+ recalculated if the terminal window is resized, so that the
+ actual scroll remains at the specified fraction of the screen
+ width.
--no-keypad
- Disables sending the keypad initialization and deinitialization
+ Disables sending the keypad initialization and deinitialization
strings to the terminal. This is sometimes useful if the keypad
strings make the numeric keypad behave in an undesirable manner.
--follow-name
- Normally, if the input file is renamed while an F command is
- executing, [4mless[24m will continue to display the contents of the
- original file despite its name change. If --follow-name is
+ Normally, if the input file is renamed while an F command is
+ executing, [4mless[24m will continue to display the contents of the
+ original file despite its name change. If --follow-name is
specified, during an F command [4mless[24m will periodically attempt to
reopen the file by name. If the reopen succeeds and the file is
- a different file from the original (which means that a new file
- has been created with the same name as the original (now
+ a different file from the original (which means that a new file
+ has been created with the same name as the original (now
renamed) file), [4mless[24m will display the contents of that new file.
- -- A command line argument of "--" marks the end of option argu-
- ments. Any arguments following this are interpreted as file-
+ -- A command line argument of "--" marks the end of option argu-
+ ments. Any arguments following this are interpreted as file-
names. This can be useful when viewing a file whose name begins
with a "-" or "+".
- + If a command line option begins with [1m+[22m, the remainder of that
- option is taken to be an initial command to [4mless.[24m For example,
- +G tells [4mless[24m to start at the end of the file rather than the
- beginning, and +/xyz tells it to start at the first occurrence
- of "xyz" in the file. As a special case, +<number> acts like
+ + If a command line option begins with [1m+[22m, the remainder of that
+ option is taken to be an initial command to [4mless.[24m For example,
+ +G tells [4mless[24m to start at the end of the file rather than the
+ beginning, and +/xyz tells it to start at the first occurrence
+ of "xyz" in the file. As a special case, +<number> acts like
+<number>g; that is, it starts the display at the specified line
- number (however, see the caveat under the "g" command above).
- If the option starts with ++, the initial command applies to
- every file being viewed, not just the first one. The + command
+ number (however, see the caveat under the "g" command above).
+ If the option starts with ++, the initial command applies to
+ every file being viewed, not just the first one. The + command
described previously may also be used to set (or change) an ini-
tial command for every file.
[1mLINE EDITING[0m
- When entering command line at the bottom of the screen (for example, a
+ When entering command line at the bottom of the screen (for example, a
filename for the :e command, or the pattern for a search command), cer-
- tain keys can be used to manipulate the command line. Most commands
- have an alternate form in [ brackets ] which can be used if a key does
- not exist on a particular keyboard. (Note that the forms beginning
- with ESC do not work in some MS-DOS and Windows systems because ESC is
- the line erase character.) Any of these special keys may be entered
- literally by preceding it with the "literal" character, either ^V or
- ^A. A backslash itself may also be entered literally by entering two
+ tain keys can be used to manipulate the command line. Most commands
+ have an alternate form in [ brackets ] which can be used if a key does
+ not exist on a particular keyboard. (Note that the forms beginning
+ with ESC do not work in some MS-DOS and Windows systems because ESC is
+ the line erase character.) Any of these special keys may be entered
+ literally by preceding it with the "literal" character, either ^V or
+ ^A. A backslash itself may also be entered literally by entering two
backslashes.
LEFTARROW [ ESC-h ]
@@ -863,7 +870,7 @@ LESS(1)
Move the cursor one space to the right.
^LEFTARROW [ ESC-b or ESC-LEFTARROW ]
- (That is, CONTROL and LEFTARROW simultaneously.) Move the cur-
+ (That is, CONTROL and LEFTARROW simultaneously.) Move the cur-
sor one word to the left.
^RIGHTARROW [ ESC-w or ESC-RIGHTARROW ]
@@ -877,18 +884,18 @@ LESS(1)
Move the cursor to the end of the line.
BACKSPACE
- Delete the character to the left of the cursor, or cancel the
+ Delete the character to the left of the cursor, or cancel the
command if the command line is empty.
DELETE or [ ESC-x ]
Delete the character under the cursor.
^BACKSPACE [ ESC-BACKSPACE ]
- (That is, CONTROL and BACKSPACE simultaneously.) Delete the
+ (That is, CONTROL and BACKSPACE simultaneously.) Delete the
word to the left of the cursor.
^DELETE [ ESC-X or ESC-DELETE ]
- (That is, CONTROL and DELETE simultaneously.) Delete the word
+ (That is, CONTROL and DELETE simultaneously.) Delete the word
under the cursor.
UPARROW [ ESC-k ]
@@ -897,96 +904,96 @@ LESS(1)
DOWNARROW [ ESC-j ]
Retrieve the next command line.
- TAB Complete the partial filename to the left of the cursor. If it
- matches more than one filename, the first match is entered into
- the command line. Repeated TABs will cycle thru the other
+ TAB Complete the partial filename to the left of the cursor. If it
+ matches more than one filename, the first match is entered into
+ the command line. Repeated TABs will cycle thru the other
matching filenames. If the completed filename is a directory, a
- "/" is appended to the filename. (On MS-DOS systems, a "\" is
- appended.) The environment variable LESSSEPARATOR can be used
- to specify a different character to append to a directory name.
+ "/" is appended to the filename. (On MS-DOS systems, a "\" is
+ appended.) The environment variable LESSSEPARATOR can be used
+ to specify a different character to append to a directory name.
BACKTAB [ ESC-TAB ]
Like, TAB, but cycles in the reverse direction thru the matching
filenames.
- ^L Complete the partial filename to the left of the cursor. If it
+ ^L Complete the partial filename to the left of the cursor. If it
matches more than one filename, all matches are entered into the
command line (if they fit).
^U (Unix and OS/2) or ESC (MS-DOS)
- Delete the entire command line, or cancel the command if the
+ Delete the entire command line, or cancel the command if the
command line is empty. If you have changed your line-kill char-
acter in Unix to something other than ^U, that character is used
instead of ^U.
[1mKEY BINDINGS[0m
- You may define your own [4mless[24m commands by using the program [4mlesskey[24m (1)
- to create a lesskey file. This file specifies a set of command keys
- and an action associated with each key. You may also use [4mlesskey[24m to
+ You may define your own [4mless[24m commands by using the program [4mlesskey[24m (1)
+ to create a lesskey file. This file specifies a set of command keys
+ and an action associated with each key. You may also use [4mlesskey[24m to
change the line-editing keys (see LINE EDITING), and to set environment
- variables. If the environment variable LESSKEY is set, [4mless[24m uses that
- as the name of the lesskey file. Otherwise, [4mless[24m looks in a standard
- place for the lesskey file: On Unix systems, [4mless[24m looks for a lesskey
- file called "$HOME/.less". On MS-DOS and Windows systems, [4mless[24m looks
- for a lesskey file called "$HOME/_less", and if it is not found there,
+ variables. If the environment variable LESSKEY is set, [4mless[24m uses that
+ as the name of the lesskey file. Otherwise, [4mless[24m looks in a standard
+ place for the lesskey file: On Unix systems, [4mless[24m looks for a lesskey
+ file called "$HOME/.less". On MS-DOS and Windows systems, [4mless[24m looks
+ for a lesskey file called "$HOME/_less", and if it is not found there,
then looks for a lesskey file called "_less" in any directory specified
- in the PATH environment variable. On OS/2 systems, [4mless[24m looks for a
- lesskey file called "$HOME/less.ini", and if it is not found, then
- looks for a lesskey file called "less.ini" in any directory specified
+ in the PATH environment variable. On OS/2 systems, [4mless[24m looks for a
+ lesskey file called "$HOME/less.ini", and if it is not found, then
+ looks for a lesskey file called "less.ini" in any directory specified
in the INIT environment variable, and if it not found there, then looks
- for a lesskey file called "less.ini" in any directory specified in the
- PATH environment variable. See the [4mlesskey[24m manual page for more
+ for a lesskey file called "less.ini" in any directory specified in the
+ PATH environment variable. See the [4mlesskey[24m manual page for more
details.
- A system-wide lesskey file may also be set up to provide key bindings.
+ A system-wide lesskey file may also be set up to provide key bindings.
If a key is defined in both a local lesskey file and in the system-wide
- file, key bindings in the local file take precedence over those in the
- system-wide file. If the environment variable LESSKEY_SYSTEM is set,
+ file, key bindings in the local file take precedence over those in the
+ system-wide file. If the environment variable LESSKEY_SYSTEM is set,
[4mless[24m uses that as the name of the system-wide lesskey file. Otherwise,
- [4mless[24m looks in a standard place for the system-wide lesskey file: On
- Unix systems, the system-wide lesskey file is /usr/local/etc/sysless.
- (However, if [4mless[24m was built with a different sysconf directory than
+ [4mless[24m looks in a standard place for the system-wide lesskey file: On
+ Unix systems, the system-wide lesskey file is /usr/local/etc/sysless.
+ (However, if [4mless[24m was built with a different sysconf directory than
/usr/local/etc, that directory is where the sysless file is found.) On
- MS-DOS and Windows systems, the system-wide lesskey file is c:\_sys-
+ MS-DOS and Windows systems, the system-wide lesskey file is c:\_sys-
less. On OS/2 systems, the system-wide lesskey file is c:\sysless.ini.
[1mINPUT PREPROCESSOR[0m
- You may define an "input preprocessor" for [4mless.[24m Before [4mless[24m opens a
+ You may define an "input preprocessor" for [4mless.[24m Before [4mless[24m opens a
file, it first gives your input preprocessor a chance to modify the way
- the contents of the file are displayed. An input preprocessor is sim-
- ply an executable program (or shell script), which writes the contents
+ the contents of the file are displayed. An input preprocessor is sim-
+ ply an executable program (or shell script), which writes the contents
of the file to a different file, called the replacement file. The con-
- tents of the replacement file are then displayed in place of the con-
- tents of the original file. However, it will appear to the user as if
- the original file is opened; that is, [4mless[24m will display the original
+ tents of the replacement file are then displayed in place of the con-
+ tents of the original file. However, it will appear to the user as if
+ the original file is opened; that is, [4mless[24m will display the original
filename as the name of the current file.
- An input preprocessor receives one command line argument, the original
- filename, as entered by the user. It should create the replacement
- file, and when finished, print the name of the replacement file to its
- standard output. If the input preprocessor does not output a replace-
- ment filename, [4mless[24m uses the original file, as normal. The input pre-
- processor is not called when viewing standard input. To set up an
- input preprocessor, set the LESSOPEN environment variable to a command
- line which will invoke your input preprocessor. This command line
- should include one occurrence of the string "%s", which will be
- replaced by the filename when the input preprocessor command is
+ An input preprocessor receives one command line argument, the original
+ filename, as entered by the user. It should create the replacement
+ file, and when finished, print the name of the replacement file to its
+ standard output. If the input preprocessor does not output a replace-
+ ment filename, [4mless[24m uses the original file, as normal. The input pre-
+ processor is not called when viewing standard input. To set up an
+ input preprocessor, set the LESSOPEN environment variable to a command
+ line which will invoke your input preprocessor. This command line
+ should include one occurrence of the string "%s", which will be
+ replaced by the filename when the input preprocessor command is
invoked.
When [4mless[24m closes a file opened in such a way, it will call another pro-
- gram, called the input postprocessor, which may perform any desired
- clean-up action (such as deleting the replacement file created by
+ gram, called the input postprocessor, which may perform any desired
+ clean-up action (such as deleting the replacement file created by
LESSOPEN). This program receives two command line arguments, the orig-
- inal filename as entered by the user, and the name of the replacement
- file. To set up an input postprocessor, set the LESSCLOSE environment
- variable to a command line which will invoke your input postprocessor.
- It may include two occurrences of the string "%s"; the first is
- replaced with the original name of the file and the second with the
+ inal filename as entered by the user, and the name of the replacement
+ file. To set up an input postprocessor, set the LESSCLOSE environment
+ variable to a command line which will invoke your input postprocessor.
+ It may include two occurrences of the string "%s"; the first is
+ replaced with the original name of the file and the second with the
name of the replacement file, which was output by LESSOPEN.
- For example, on many Unix systems, these two scripts will allow you to
+ For example, on many Unix systems, these two scripts will allow you to
keep files in compressed format, but still let [4mless[24m view them directly:
lessopen.sh:
@@ -1005,25 +1012,25 @@ LESS(1)
#! /bin/sh
rm $2
- To use these scripts, put them both where they can be executed and set
+ To use these scripts, put them both where they can be executed and set
LESSOPEN="lessopen.sh %s", and LESSCLOSE="lessclose.sh %s %s". More
- complex LESSOPEN and LESSCLOSE scripts may be written to accept other
+ complex LESSOPEN and LESSCLOSE scripts may be written to accept other
types of compressed files, and so on.
- It is also possible to set up an input preprocessor to pipe the file
- data directly to [4mless,[24m rather than putting the data into a replacement
+ It is also possible to set up an input preprocessor to pipe the file
+ data directly to [4mless,[24m rather than putting the data into a replacement
file. This avoids the need to decompress the entire file before start-
ing to view it. An input preprocessor that works this way is called an
- input pipe. An input pipe, instead of writing the name of a replace-
- ment file on its standard output, writes the entire contents of the
- replacement file on its standard output. If the input pipe does not
- write any characters on its standard output, then there is no replace-
- ment file and [4mless[24m uses the original file, as normal. To use an input
- pipe, make the first character in the LESSOPEN environment variable a
- vertical bar (|) to signify that the input preprocessor is an input
+ input pipe. An input pipe, instead of writing the name of a replace-
+ ment file on its standard output, writes the entire contents of the
+ replacement file on its standard output. If the input pipe does not
+ write any characters on its standard output, then there is no replace-
+ ment file and [4mless[24m uses the original file, as normal. To use an input
+ pipe, make the first character in the LESSOPEN environment variable a
+ vertical bar (|) to signify that the input preprocessor is an input
pipe.
- For example, on many Unix systems, this script will work like the pre-
+ For example, on many Unix systems, this script will work like the pre-
vious example scripts:
lesspipe.sh:
@@ -1034,15 +1041,21 @@ LESS(1)
esac
To use this script, put it where it can be executed and set
- LESSOPEN="|lesspipe.sh %s". When an input pipe is used, a LESSCLOSE
- postprocessor can be used, but it is usually not necessary since there
+ LESSOPEN="|lesspipe.sh %s". When an input pipe is used, a LESSCLOSE
+ postprocessor can be used, but it is usually not necessary since there
is no replacement file to clean up. In this case, the replacement file
name passed to the LESSCLOSE postprocessor is "-".
- For compatibility with previous versions of [4mless,[24m the input pipe is not
- used if [4mless[24m is viewing standard input. However, if the character
- after the vertical bar is a dash (-), the input pipe is used on stan-
- dard input as well as other files.
+ For compatibility with previous versions of [4mless,[24m the input preproces-
+ sor or pipe is not used if [4mless[24m is viewing standard input. However, if
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-all
mailing list