]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC r243834:
authordelphij <delphij@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Mon, 17 Dec 2012 06:38:22 +0000 (06:38 +0000)
committerdelphij <delphij@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Mon, 17 Dec 2012 06:38:22 +0000 (06:38 +0000)
commit71eb43507aa0677a987eff4cdbb2a8db252d2277
treeed85f76b1a78961fcd637909850d6a8ab93e8860
parentf1fa2b8ec8c4ec676f75d70a29fbdeec4bef3a08
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

git-svn-id: svn://svn.freebsd.org/base/stable/8@244343 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
usr.bin/less/zless.sh