summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2020-07-14 16:43:53 -0400
committerJakob Kaivo <jkk@ung.org>2020-07-14 16:43:53 -0400
commit6b8dfa2858c16b3cba4cd1e560000c47db3e50e6 (patch)
treede86d0578c2ab61657835c3fa3d2012180e9d3ea
parentc494561b43b264223b7a8f800221b7e87dbb67eb (diff)
remove unnecessary headers
-rw-r--r--more.c6
-rw-r--r--tty.c1
2 files changed, 5 insertions, 2 deletions
diff --git a/more.c b/more.c
index 88134b4..07180ba 100644
--- a/more.c
+++ b/more.c
@@ -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);
diff --git a/tty.c b/tty.c
index 375601c..3752cd7 100644
--- a/tty.c
+++ b/tty.c
@@ -3,7 +3,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <termios.h>
-#include <unistd.h>
#include "more.h"