summaryrefslogtreecommitdiff
path: root/usr.bin/less
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2012-12-03 21:49:37 +0000
committerXin LI <delphij@FreeBSD.org>2012-12-03 21:49:37 +0000
commit266ab5afbc6791f8ad90791f99066c6a29e21593 (patch)
tree0336e9d0aae6c87c529a3d589fbbc652b9cf3bce /usr.bin/less
parent4153fe7216a342244b555bfd03609e28604df202 (diff)
downloadsrc-test-266ab5afbc6791f8ad90791f99066c6a29e21593.tar.gz
src-test-266ab5afbc6791f8ad90791f99066c6a29e21593.zip
Note that the manual page of less(1) says:
Note that a preprocessor cannot output an empty file, since that is interpreted as meaning there is no replacement, and the origi- nal file is used. To avoid this, if LESSOPEN starts with two ver- tical bars, the exit status of the script becomes meaningful. If the exit status is zero, the output is considered to be replace- ment text, even if it empty. If the exit status is nonzero, any output is ignored and the original file is used. For compatibil- ity with previous versions of less, if LESSOPEN starts with only one vertical bar, the exit status of the preprocessor is ignored. Use two pipe symbols for zless, so that zless'ing a compressed empty file will give output rather than being interpreted as its compressed form, which is typically a binary. Thanks Mark Nudelman for pointing out this difference and the suggested solution. Reported by: Matthias Meyser <meyser xenet.de> PR: bin/168839 MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=243834
Diffstat (limited to 'usr.bin/less')
-rw-r--r--usr.bin/less/zless.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/less/zless.sh b/usr.bin/less/zless.sh
index b947b819f2c04..f2e035c2d7e25 100644
--- a/usr.bin/less/zless.sh
+++ b/usr.bin/less/zless.sh
@@ -3,5 +3,5 @@
# $FreeBSD$
#
-export LESSOPEN="|/usr/bin/lesspipe.sh %s"
+export LESSOPEN="||/usr/bin/lesspipe.sh %s"
exec /usr/bin/less "$@"