summaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
authorEric Andersen2001-12-06 07:24:29 +0000
committerEric Andersen2001-12-06 07:24:29 +0000
commit0ee0a8d5396c9da17ba47991715da3ff8ea484f1 (patch)
tree41212df3f3f550af86674d69c143f612d755ae26 /util-linux
parentb6ecbdc07dc444fb94e2024131df2f51d17399dd (diff)
downloadbusybox-0ee0a8d5396c9da17ba47991715da3ff8ea484f1.zip
busybox-0ee0a8d5396c9da17ba47991715da3ff8ea484f1.tar.gz
Fix running more on files in the (broken) procfs that claim 0 length
when that isn't actually true. -Erik
Diffstat (limited to 'util-linux')
-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 5fe1da4..cc5f86e 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) /