convert() is used by dos2unix and unix2dos
[oweals/busybox.git] / more.c
diff --git a/more.c b/more.c
index b89143e4d6f14b3c61a440b8f3a63a8590be6a73..732396f03341a918b974136b3911f1cb97b85c2b 100644 (file)
--- a/more.c
+++ b/more.c
@@ -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)",
+                                                  (int) (100 * ((double) ftell(file) /
+                                                  (double) st.st_size)), (long long)st.st_size);
 #else
                                        len += printf("(%d%% of %ld bytes)",
+                                                  (int) (100 * ((double) ftell(file) /
+                                                  (double) st.st_size)), (long)st.st_size);
 #endif
-                                                                  (int) (100 *
-                                                                                 ((double) ftell(file) /
-                                                                                  (double) st.st_size)),
-                                                                  st.st_size);
                                }
                                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 */
+                               putc('\r', stdout);
                                while (--len >= 0)
-                                       putc('\b', stdout);
-                               while (++len <= terminal_width)
                                        putc(' ', stdout);
-                               while (--len >= 0)
-                                       putc('\b', stdout);
+                               putc('\r', stdout);
                                fflush(stdout);
 #endif
                                len=0;