# HG changeset patch # User Rob Landley # Date 1417215413 21600 # Node ID e1dd7fb3920c9e0387bbdb2625eb0eeb30e43023 # Parent 22a910100df7f551d9358d40b5dc8617d3aecd8a Tiny in-passing cleanups to more.c. diff -r 22a910100df7 -r e1dd7fb3920c toys/pending/more.c --- 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 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; }