diff options
| -rw-r--r-- | more.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -52,6 +52,7 @@ struct more_file { char *buf; size_t nbuf; char *path; + int eof; }; static int more_clear = 0; @@ -82,6 +83,8 @@ static ssize_t more_getline(struct more_file *mf, size_t lineno) fgetpos(mf->f, &(mf->tlines[mf->nlines - 1])); if (getline(&(mf->buf), &(mf->nbuf), mf->f) == -1) { + mf->nlines--; + mf->eof = 1; return -1; } |
