From owner-svn-src-stable-8@FreeBSD.ORG Wed Aug 17 15:19:26 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04441106564A; Wed, 17 Aug 2011 15:19:26 +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 E70768FC16; Wed, 17 Aug 2011 15:19:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7HFJPBZ010890; Wed, 17 Aug 2011 15:19:25 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7HFJPp1010888; Wed, 17 Aug 2011 15:19:25 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201108171519.p7HFJPp1010888@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 17 Aug 2011 15:19:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224944 - stable/8/usr.bin/rs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Aug 2011 15:19:26 -0000 Author: jh Date: Wed Aug 17 15:19:25 2011 New Revision: 224944 URL: http://svn.freebsd.org/changeset/base/224944 Log: MFC r218410: Handle EOF when skipping lines. Modified: stable/8/usr.bin/rs/rs.c Directory Properties: stable/8/usr.bin/rs/ (props changed) Modified: stable/8/usr.bin/rs/rs.c ============================================================================== --- stable/8/usr.bin/rs/rs.c Wed Aug 17 15:13:07 2011 (r224943) +++ stable/8/usr.bin/rs/rs.c Wed Aug 17 15:19:25 2011 (r224944) @@ -130,14 +130,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)