mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Correct the handling of (for example) the N command by only zeroing the
input space in mf_fgets() if we reach the end of all input files.
This commit is contained in:
parent
2b13992856
commit
254fac850d
1 changed files with 2 additions and 1 deletions
|
|
@ -315,7 +315,6 @@ mf_fgets(sp, spflag)
|
|||
firstfile = 1;
|
||||
}
|
||||
|
||||
sp->len = 0;
|
||||
for (;;) {
|
||||
if (f != NULL && (c = getc(f)) != EOF) {
|
||||
(void)ungetc(c, f);
|
||||
|
|
@ -323,6 +322,7 @@ mf_fgets(sp, spflag)
|
|||
}
|
||||
/* If we are here then either eof or no files are open yet */
|
||||
if (f == stdin) {
|
||||
sp->len = 0;
|
||||
lastline = 1;
|
||||
return (0);
|
||||
}
|
||||
|
|
@ -334,6 +334,7 @@ mf_fgets(sp, spflag)
|
|||
} else
|
||||
firstfile = 0;
|
||||
if (files == NULL) {
|
||||
sp->len = 0;
|
||||
lastline = 1;
|
||||
return (0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue