aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-12-06 07:24:29 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-12-06 07:24:29 +0000
commit361ec10251d7d62e42e61a32788185e1e6839264 (patch)
tree41212df3f3f550af86674d69c143f612d755ae26
parent4048d324f57bdc53d9592f02068e2256470bf456 (diff)
downloadbusybox-w32-361ec10251d7d62e42e61a32788185e1e6839264.tar.gz
busybox-w32-361ec10251d7d62e42e61a32788185e1e6839264.tar.bz2
busybox-w32-361ec10251d7d62e42e61a32788185e1e6839264.zip
Fix running more on files in the (broken) procfs that claim 0 length
when that isn't actually true. -Erik git-svn-id: svn://busybox.net/trunk/busybox@3836 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--util-linux/more.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/util-linux/more.c b/util-linux/more.c
index 5fe1da423..cc5f86e0d 100644
--- a/util-linux/more.c
+++ b/util-linux/more.c
@@ -109,6 +109,7 @@ extern int more_main(int argc, char **argv)
109 if(file==0) 109 if(file==0)
110 goto loop; 110 goto loop;
111 111
112 st.st_size = 0;
112 fstat(fileno(file), &st); 113 fstat(fileno(file), &st);
113 114
114 if(please_display_more_prompt>0) 115 if(please_display_more_prompt>0)
@@ -128,7 +129,7 @@ extern int more_main(int argc, char **argv)
128 129
129 if (please_display_more_prompt>0) { 130 if (please_display_more_prompt>0) {
130 len = printf("--More-- "); 131 len = printf("--More-- ");
131 if (file != stdin) { 132 if (file != stdin && st.st_size > 0) {
132#if _FILE_OFFSET_BITS == 64 133#if _FILE_OFFSET_BITS == 64
133 len += printf("(%d%% of %lld bytes)", 134 len += printf("(%d%% of %lld bytes)",
134 (int) (100 * ((double) ftell(file) / 135 (int) (100 * ((double) ftell(file) /