From owner-svn-src-all@FreeBSD.ORG Mon Dec 17 06:38:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DC6BF5FB; Mon, 17 Dec 2012 06:38:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A8EA88FC15; Mon, 17 Dec 2012 06:38:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBH6cMNx034372; Mon, 17 Dec 2012 06:38:22 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBH6cMqT034371; Mon, 17 Dec 2012 06:38:22 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201212170638.qBH6cMqT034371@svn.freebsd.org> From: Xin LI Date: Mon, 17 Dec 2012 06:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r244343 - stable/8/usr.bin/less X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Dec 2012 06:38:23 -0000 Author: delphij Date: Mon Dec 17 06:38:22 2012 New Revision: 244343 URL: http://svnweb.freebsd.org/changeset/base/244343 Log: 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 PR: bin/168839 Modified: stable/8/usr.bin/less/zless.sh Directory Properties: stable/8/usr.bin/less/ (props changed) Modified: stable/8/usr.bin/less/zless.sh ============================================================================== --- stable/8/usr.bin/less/zless.sh Mon Dec 17 06:35:15 2012 (r244342) +++ stable/8/usr.bin/less/zless.sh Mon Dec 17 06:38:22 2012 (r244343) @@ -3,5 +3,5 @@ # $FreeBSD$ # -export LESSOPEN="|/usr/bin/lesspipe.sh %s" +export LESSOPEN="||/usr/bin/lesspipe.sh %s" exec /usr/bin/less "$@"