From owner-svn-src-stable-7@FreeBSD.ORG Fri Oct 7 14:27:20 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F6D3106567F; Fri, 7 Oct 2011 14:27:20 +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 5E44B8FC08; Fri, 7 Oct 2011 14:27:20 +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 p97ERKrF014742; Fri, 7 Oct 2011 14:27:20 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p97ERK5U014740; Fri, 7 Oct 2011 14:27:20 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201110071427.p97ERK5U014740@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 7 Oct 2011 14:27:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226106 - stable/7/usr.bin/rs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Oct 2011 14:27:20 -0000 Author: jh Date: Fri Oct 7 14:27:20 2011 New Revision: 226106 URL: http://svn.freebsd.org/changeset/base/226106 Log: MFC r218410: Handle EOF when skipping lines. Modified: stable/7/usr.bin/rs/rs.c Directory Properties: stable/7/usr.bin/rs/ (props changed) Modified: stable/7/usr.bin/rs/rs.c ============================================================================== --- stable/7/usr.bin/rs/rs.c Fri Oct 7 13:43:01 2011 (r226105) +++ stable/7/usr.bin/rs/rs.c Fri Oct 7 14:27:20 2011 (r226106) @@ -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)