1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-23 11:18:54 +00:00
freebsd/usr.bin/less
Xin LI 266ab5afbc 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
2012-12-03 21:49:37 +00:00
..
defines.h Fix build with clang: properly terminate comment even in #if 0 blocks. 2012-11-05 17:42:50 +00:00
lesspipe.sh Import of liblzma, xz, xzdec, lzmainfo from vendor branch 2010-05-10 06:59:50 +00:00
Makefile Import of liblzma, xz, xzdec, lzmainfo from vendor branch 2010-05-10 06:59:50 +00:00
Makefile.common Build usr.bin/ with WARNS=6 by default. 2010-01-02 10:27:05 +00:00
zless.sh Note that the manual page of less(1) says: 2012-12-03 21:49:37 +00:00