Handle EOF when skipping lines.
This commit is contained in:
parent
3118fac370
commit
a373cd6a6f
@ -126,14 +126,17 @@ getfile(void)
|
|||||||
char *p;
|
char *p;
|
||||||
char *endp;
|
char *endp;
|
||||||
char **ep;
|
char **ep;
|
||||||
|
int c;
|
||||||
int multisep = (flags & ONEISEPONLY ? 0 : 1);
|
int multisep = (flags & ONEISEPONLY ? 0 : 1);
|
||||||
int nullpad = flags & NULLPAD;
|
int nullpad = flags & NULLPAD;
|
||||||
char **padto;
|
char **padto;
|
||||||
|
|
||||||
while (skip--) {
|
while (skip--) {
|
||||||
getline();
|
c = getline();
|
||||||
if (flags & SKIPPRINT)
|
if (flags & SKIPPRINT)
|
||||||
puts(curline);
|
puts(curline);
|
||||||
|
if (c == EOF)
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
getline();
|
getline();
|
||||||
if (flags & NOARGS && curlen < owidth)
|
if (flags & NOARGS && curlen < owidth)
|
||||||
|
Loading…
Reference in New Issue
Block a user