From owner-svn-src-all@FreeBSD.ORG Mon Feb 7 18:05:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E5A5106566B; Mon, 7 Feb 2011 18:05:57 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EFA48FC1B; Mon, 7 Feb 2011 18:05:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p17I5vue017413; Mon, 7 Feb 2011 18:05:57 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p17I5vXV017411; Mon, 7 Feb 2011 18:05:57 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201102071805.p17I5vXV017411@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 7 Feb 2011 18:05:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218410 - head/usr.bin/rs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 07 Feb 2011 18:05:57 -0000 Author: jh Date: Mon Feb 7 18:05:56 2011 New Revision: 218410 URL: http://svn.freebsd.org/changeset/base/218410 Log: Handle EOF when skipping lines. Modified: head/usr.bin/rs/rs.c Modified: head/usr.bin/rs/rs.c ============================================================================== --- head/usr.bin/rs/rs.c Mon Feb 7 17:04:31 2011 (r218409) +++ head/usr.bin/rs/rs.c Mon Feb 7 18:05:56 2011 (r218410) @@ -126,14 +126,17 @@ getfile(void) char *p; char *endp; char **ep; + int c; int multisep = (flags & ONEISEPONLY ? 0 : 1); int nullpad = flags & NULLPAD; char **padto; while (skip--) { - getline(); + c = getline(); if (flags & SKIPPRINT) puts(curline); + if (c == EOF) + return; } getline(); if (flags & NOARGS && curlen < owidth)