projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
convert() is used by dos2unix and unix2dos
[oweals/busybox.git]
/
more.c
diff --git
a/more.c
b/more.c
index f8b17b34afac0821814da2954037e07345fdcf25..732396f03341a918b974136b3911f1cb97b85c2b 100644
(file)
--- a/
more.c
+++ b/
more.c
@@
-91,7
+91,7
@@
extern int more_main(int argc, char **argv)
#ifdef BB_FEATURE_USE_TERMIOS
cin = fopen("/dev/tty", "r");
if (!cin)
#ifdef BB_FEATURE_USE_TERMIOS
cin = fopen("/dev/tty", "r");
if (!cin)
- cin = fopen("/dev/console", "r");
+ cin =
x
fopen("/dev/console", "r");
getTermSettings(fileno(cin), &initial_settings);
new_settings = initial_settings;
new_settings.c_cc[VMIN] = 1;
getTermSettings(fileno(cin), &initial_settings);
new_settings = initial_settings;
new_settings.c_cc[VMIN] = 1;
@@
-124,13
+124,13
@@
extern int more_main(int argc, char **argv)
if (file != stdin) {
#if _FILE_OFFSET_BITS == 64
len += printf("(%d%% of %lld bytes)",
if (file != stdin) {
#if _FILE_OFFSET_BITS == 64
len += printf("(%d%% of %lld bytes)",
+ (int) (100 * ((double) ftell(file) /
+ (double) st.st_size)), (long long)st.st_size);
#else
len += printf("(%d%% of %ld bytes)",
#else
len += printf("(%d%% of %ld bytes)",
+ (int) (100 * ((double) ftell(file) /
+ (double) st.st_size)), (long)st.st_size);
#endif
#endif
- (int) (100 *
- ((double) ftell(file) /
- (double) st.st_size)),
- st.st_size);
}
len += printf("%s",
#ifdef BB_FEATURE_USE_TERMIOS
}
len += printf("%s",
#ifdef BB_FEATURE_USE_TERMIOS
@@
-154,12
+154,10
@@
extern int more_main(int argc, char **argv)
#ifdef BB_FEATURE_USE_TERMIOS
/* Erase the "More" message */
#ifdef BB_FEATURE_USE_TERMIOS
/* Erase the "More" message */
+ putc('\r', stdout);
while (--len >= 0)
while (--len >= 0)
- putc('\b', stdout);
- while (++len <= terminal_width)
putc(' ', stdout);
putc(' ', stdout);
- while (--len >= 0)
- putc('\b', stdout);
+ putc('\r', stdout);
fflush(stdout);
#endif
len=0;
fflush(stdout);
#endif
len=0;