Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Dec 2012 06:35:15 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r244342 - stable/9/usr.bin/less
Message-ID:  <201212170635.qBH6ZF8f033967@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Mon Dec 17 06:35:15 2012
New Revision: 244342
URL: http://svnweb.freebsd.org/changeset/base/244342

Log:
  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

Modified:
  stable/9/usr.bin/less/zless.sh
Directory Properties:
  stable/9/usr.bin/less/   (props changed)

Modified: stable/9/usr.bin/less/zless.sh
==============================================================================
--- stable/9/usr.bin/less/zless.sh	Mon Dec 17 06:01:57 2012	(r244341)
+++ stable/9/usr.bin/less/zless.sh	Mon Dec 17 06:35:15 2012	(r244342)
@@ -3,5 +3,5 @@
 # $FreeBSD$
 #
 
-export LESSOPEN="|/usr/bin/lesspipe.sh %s"
+export LESSOPEN="||/usr/bin/lesspipe.sh %s"
 exec /usr/bin/less "$@"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212170635.qBH6ZF8f033967>