diff options
author | Jakob Kaivo <jkk@ung.org> | 2020-07-14 16:43:53 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2020-07-14 16:43:53 -0400 |
commit | 6b8dfa2858c16b3cba4cd1e560000c47db3e50e6 (patch) | |
tree | de86d0578c2ab61657835c3fa3d2012180e9d3ea | |
parent | c494561b43b264223b7a8f800221b7e87dbb67eb (diff) |
remove unnecessary headers
-rw-r--r-- | more.c | 6 | ||||
-rw-r--r-- | tty.c | 1 |
2 files changed, 5 insertions, 2 deletions
@@ -1,7 +1,6 @@ #define _XOPEN_SOURCE 700 #include <ctype.h> #include <errno.h> -#include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -50,9 +49,12 @@ void refresh(const struct more_tty *mt, struct morefile *mf) char *line = NULL; size_t n = 0; for (size_t i = mf->topline; i < mf->topline + mt->lines; i++) { + /* FIXME: account for long lines */ + if (more_getline(mf, i, &line, &n) == -1) { break; } + printf("%s", line); } free(line); @@ -72,6 +74,8 @@ void scroll(const struct more_tty *mt, struct morefile *mf, int count, int multi } refresh(mt, mf); } else while (by-- > 0) { + /* FIXME: account for long lines here, too */ + mf->topline++; more_getline(mf, mf->topline + mt->lines + 1, &line, &n); printf("%s", line); @@ -3,7 +3,6 @@ #include <stdio.h> #include <stdlib.h> #include <termios.h> -#include <unistd.h> #include "more.h" |