From owner-svn-src-all@FreeBSD.ORG Sun May 4 12:20:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 580695CC; Sun, 4 May 2014 12:20:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 452F51FCA; Sun, 4 May 2014 12:20:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s44CKfMb060224; Sun, 4 May 2014 12:20:41 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s44CKeDR060222; Sun, 4 May 2014 12:20:40 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201405041220.s44CKeDR060222@svn.freebsd.org> From: Sergey Kandaurov Date: Sun, 4 May 2014 12:20:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265319 - head/usr.bin/nl X-SVN-Group: head 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.17 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: Sun, 04 May 2014 12:20:41 -0000 Author: pluknet Date: Sun May 4 12:20:40 2014 New Revision: 265319 URL: http://svnweb.freebsd.org/changeset/base/265319 Log: Treat the '-' as meaning standard input. Obtained from: NetBSD Modified: head/usr.bin/nl/nl.1 head/usr.bin/nl/nl.c Modified: head/usr.bin/nl/nl.1 ============================================================================== --- head/usr.bin/nl/nl.1 Sun May 4 10:14:25 2014 (r265318) +++ head/usr.bin/nl/nl.1 Sun May 4 12:20:40 2014 (r265319) @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 26, 2005 +.Dd May 4, 2014 .Dt NL 1 .Os .Sh NAME @@ -71,12 +71,16 @@ The .Nm utility reads lines from the named +.Ar file , +applies a configurable line numbering filter operation, +and writes the result to the standard output. +If .Ar file -or the standard input if the -.Ar file -argument is omitted, -applies a configurable line numbering filter operation and writes the result -to the standard output. +is a single dash +.Pq Sq Fl +or absent, +.Nm +reads from the standard input. .Pp The .Nm Modified: head/usr.bin/nl/nl.c ============================================================================== --- head/usr.bin/nl/nl.c Sun May 4 10:14:25 2014 (r265318) +++ head/usr.bin/nl/nl.c Sun May 4 12:20:40 2014 (r265319) @@ -242,7 +242,8 @@ main(int argc, char *argv[]) case 0: break; case 1: - if (freopen(argv[0], "r", stdin) == NULL) + if (strcmp(argv[0], "-") != 0 && + freopen(argv[0], "r", stdin) == NULL) err(EXIT_FAILURE, "%s", argv[0]); break; default: