Updates from both Vladimir and Larry
[oweals/busybox.git] / more.c
diff --git a/more.c b/more.c
index ffc79b179c98c569c45b75630fdbc5cb341f27b8..9f07633c3269b753c3bfeb71bdc45c50a86a5bbf 100644 (file)
--- a/more.c
+++ b/more.c
@@ -31,9 +31,6 @@
 #include <stdlib.h>
 #include <sys/ioctl.h>
 #include "busybox.h"
-#define BB_DECLARE_EXTERN
-#define bb_need_help
-#include "messages.c"
 
 /* ED: sparc termios is broken: revert back to old termio handling. */
 #ifdef BB_FEATURE_USE_TERMIOS
@@ -187,12 +184,14 @@ extern int more_main(int argc, char **argv)
                                /* Adjust the terminal height for any overlap, so that
                                 * no lines get lost off the top. */
                                if (len >= terminal_width) {
-                                       div_t result = div( len, terminal_width); 
-                                       if (result.quot) {
-                                               if (result.rem)
-                                                       page_height-=result.quot;
+                                       int quot, rem;
+                                       quot = len / terminal_width;
+                                       rem  = len - (quot * terminal_width);
+                                       if (quot) {
+                                               if (rem)
+                                                       page_height-=quot;
                                                else
-                                                       page_height-=(result.quot-1);
+                                                       page_height-=(quot-1);
                                        }
                                }
                                if (++lines >= page_height) {