diff options
Diffstat (limited to 'io.c')
| -rw-r--r-- | io.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -11,16 +11,16 @@ ssize_t more_getline(struct more_file *mf, size_t lineno) { if (mf->nlines <= lineno && mf->nlines != 0) { - fsetpos(mf->f, &(mf->lines[mf->nlines - 1])); + fsetpos(mf->f, &(mf->tlines[mf->nlines - 1])); getline(&(mf->buf), &(mf->nbuf), mf->f); } while (mf->nlines <= lineno) { mf->nlines++; - mf->lines = realloc(mf->lines, mf->nlines * sizeof(*mf->lines)); + mf->tlines = realloc(mf->tlines, mf->nlines * sizeof(*mf->tlines)); mf->bytepos = realloc(mf->bytepos, mf->nlines * sizeof(*mf->bytepos)); - fgetpos(mf->f, &(mf->lines[mf->nlines - 1])); + fgetpos(mf->f, &(mf->tlines[mf->nlines - 1])); getline(&(mf->buf), &(mf->nbuf), mf->f); if (mf->nlines > 1) { @@ -30,12 +30,12 @@ ssize_t more_getline(struct more_file *mf, size_t lineno) } if (mf->backing != mf->f) { - fgetpos(mf->backing, &(mf->lines[mf->nlines - 1])); + fgetpos(mf->backing, &(mf->tlines[mf->nlines - 1])); fputs(mf->buf, mf->backing); } } - fsetpos(mf->backing, &(mf->lines[lineno])); + fsetpos(mf->backing, &(mf->tlines[lineno])); return getline(&(mf->buf), &(mf->nbuf), mf->backing); } @@ -76,6 +76,6 @@ void more_close(struct more_file *mf) fclose(mf->f); } - free(mf->lines); + free(mf->tlines); free(mf->buf); } |
