diff options
-rw-r--r-- | more.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -777,6 +777,7 @@ static int more_cat(const char *path, void (*loop)(FILE *)) static void more_exit(void) { tcsetattr(fileno(more_in), TCSANOW, &more_term); + printf("\n"); } int main(int argc, char *argv[]) @@ -837,8 +838,8 @@ int main(int argc, char *argv[]) return ret; } - more_in = stderr; - if (1 || read(fileno(more_in), NULL, 0) == -1) { + more_in = fdopen(STDERR_FILENO, "r"); + if (more_in == NULL) { more_in = fopen("/dev/tty", "r"); } |