aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2012-12-17 06:38:22 +0000
committerXin LI <delphij@FreeBSD.org>2012-12-17 06:38:22 +0000
commit511b2b9555659cd2777a6aeb0f9cb6b352836ea8 (patch)
treeed85f76b1a78961fcd637909850d6a8ab93e8860 /usr.bin
parenta3c903037bcdd6023a5d53cd67f1facad60d8310 (diff)
downloadsrc-511b2b9555659cd2777a6aeb0f9cb6b352836ea8.tar.gz
src-511b2b9555659cd2777a6aeb0f9cb6b352836ea8.zip
MFC r243834:
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
Notes
Notes: svn path=/stable/8/; revision=244343
Diffstat (limited to 'usr.bin')
-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 b947b819f2c0..f2e035c2d7e2 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 "$@"