OSDN Git Service

Fix more to a non-tty.
authorElliott Hughes <enh@google.com>
Fri, 22 Apr 2016 00:41:40 +0000 (17:41 -0700)
committerRob Landley <rob@landley.net>
Sat, 23 Apr 2016 18:27:53 +0000 (13:27 -0500)
And add a test.

toys/pending/more.c

index 55bed36..59b5c61 100644 (file)
@@ -63,7 +63,7 @@ static int prompt(FILE *cin, const char* fmt, ...)
 static void do_cat_operation(int fd, char *name)
 {
   if (toys.optc > 1) show_file_header(name);
-  xsendfile(0, 1);
+  xsendfile(fd, 1);
 }
 
 void more_main()