Add in ifconfig and route
[oweals/busybox.git] / cmdedit.c
index 9c2facc7b0ad410a061bba24836c39e86fe0eedf..2e57b9a349e1be06446848f9af10bb5257b048c6 100644 (file)
--- a/cmdedit.c
+++ b/cmdedit.c
@@ -54,6 +54,9 @@
 #include <sys/stat.h>
 #endif
 
+#include "pwd_grp/pwd.h"
+
+
 static const int MAX_HISTORY = 15;             /* Maximum length of the linked list for the command line history */
 
 enum {
@@ -136,11 +139,14 @@ static void win_changed(int nsig)
        struct winsize win = { 0, 0, 0, 0 };
        static __sighandler_t previous_SIGWINCH_handler; /* for reset */
 
-          /* emulate signal call if not called as a sig handler */
+       /* emulate signal call if not called as a sig handler */
        if(nsig == -SIGWINCH || nsig == SIGWINCH) {
                ioctl(0, TIOCGWINSZ, &win);
                if (win.ws_col > 0) {
                        cmdedit_setwidth( win.ws_col, nsig == SIGWINCH );
+               } else {
+                       /* Default to 79 if their console doesn't want to share */
+                       cmdedit_setwidth( 79, nsig == SIGWINCH );
                }
        }
        
@@ -315,7 +321,7 @@ static void cmdedit_setwidth(int w, int redraw_flg)
                                input_backward();
                }
        } else {
-               error_msg("\n*** Error: minimum screen width is %d\n", cmdedit_termw);
+               error_msg("\n*** Error: minimum screen width is %d", cmdedit_termw);
        }
 }