From 361ec10251d7d62e42e61a32788185e1e6839264 Mon Sep 17 00:00:00 2001 From: andersen Date: Thu, 6 Dec 2001 07:24:29 +0000 Subject: 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 --- util-linux/more.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) if(file==0) goto loop; + st.st_size = 0; fstat(fileno(file), &st); if(please_display_more_prompt>0) @@ -128,7 +129,7 @@ extern int more_main(int argc, char **argv) if (please_display_more_prompt>0) { len = printf("--More-- "); - if (file != stdin) { + if (file != stdin && st.st_size > 0) { #if _FILE_OFFSET_BITS == 64 len += printf("(%d%% of %lld bytes)", (int) (100 * ((double) ftell(file) / -- cgit v1.2.3-55-g6feb