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)
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"