summaryrefslogtreecommitdiff
path: root/scripts/kconfig
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2002-12-15 00:04:16 -0800
committerLinus Torvalds <torvalds@home.transmeta.com>2002-12-15 00:04:16 -0800
commitb2737a080b6aea895ecce6bf01d6993272b2d629 (patch)
tree3fc3fbf8323966a892901c929cae82f7e9a193ab /scripts/kconfig
parentd282afeb2d8d241081242ef48136aac955cfa3dc (diff)
[PATCH] kconfig: geometry defaults
Set geometry defaults, if TIOCGWINSZ fails.
Diffstat (limited to 'scripts/kconfig')
-rw-r--r--scripts/kconfig/mconf.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index 30148873184c..48a2c02334b0 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -111,6 +111,7 @@ static int cprint(const char *fmt, ...);
static void init_wsize(void)
{
struct winsize ws;
+ char *env;
if (ioctl(1, TIOCGWINSZ, &ws) == -1) {
rows = 24;
@@ -118,6 +119,20 @@ static void init_wsize(void)
} else {
rows = ws.ws_row;
cols = ws.ws_col;
+ if (!rows) {
+ env = getenv("LINES");
+ if (env)
+ rows = atoi(env);
+ if (!rows)
+ rows = 24;
+ }
+ if (!cols) {
+ env = getenv("COLUMNS");
+ if (env)
+ cols = atoi(env);
+ if (!cols)
+ cols = 80;
+ }
}
if (rows < 19 || cols < 80) {