changeset 1582:e1dd7fb3920c draft

Tiny in-passing cleanups to more.c.
author Rob Landley <rob@landley.net>
date Fri, 28 Nov 2014 16:56:53 -0600
parents 22a910100df7
children ae2e2fa5fbd1
files toys/pending/more.c
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/toys/pending/more.c	Fri Nov 28 16:53:59 2014 -0600
+++ b/toys/pending/more.c	Fri Nov 28 16:56:53 2014 -0600
@@ -17,7 +17,6 @@
 
 #define FOR_more
 #include "toys.h"
-#include <signal.h>
 
 GLOBALS(
   struct termios inf;
@@ -52,7 +51,6 @@
 
   if (!isatty(STDOUT_FILENO) || !(cin = fopen("/dev/tty", "r"))) {
     loopfiles(toys.optargs, do_cat_operation);
-    toys.exitval = 0;
     return;
   }
 
@@ -89,7 +87,7 @@
         if (st.st_size) 
           more_msg_len += printf("(%d%% of %lld bytes)",
               (int) (100 * ( (double) ftell(fp) / (double) st.st_size)), 
-              st.st_size);
+              (long long)st.st_size);
         fflush(NULL);
 
         while (1) {
@@ -117,5 +115,6 @@
 stop:
   tcsetattr(TT.cin_fd, TCSANOW, &TT.inf);
   fclose(cin);
+  // Even if optarg not found, exit value still 0
   toys.exitval = 0;
 }