--- shell.cold 2010-07-25 23:40:06 +0200 +++ shell.c 2013-10-17 16:29:59 +0200 @@ -117,45 +117,47 @@ return (result); } /* Set the environment variables LINES and COLUMNS to lines and cols, respectively. */ void sh_set_lines_and_columns (lines, cols) int lines, cols; { char *b; + if (getenv ("LINES") && getenv ("COLUMNS")) { #if defined (HAVE_SETENV) b = (char *)xmalloc (INT_STRLEN_BOUND (int) + 1); sprintf (b, "%d", lines); setenv ("LINES", b, 1); xfree (b); b = (char *)xmalloc (INT_STRLEN_BOUND (int) + 1); sprintf (b, "%d", cols); setenv ("COLUMNS", b, 1); xfree (b); #else /* !HAVE_SETENV */ # if defined (HAVE_PUTENV) b = (char *)xmalloc (INT_STRLEN_BOUND (int) + sizeof ("LINES=") + 1); sprintf (b, "LINES=%d", lines); putenv (b); b = (char *)xmalloc (INT_STRLEN_BOUND (int) + sizeof ("COLUMNS=") + 1); sprintf (b, "COLUMNS=%d", cols); putenv (b); # endif /* HAVE_PUTENV */ #endif /* !HAVE_SETENV */ + } } char * sh_get_env_value (varname) const char *varname; { return ((char *)getenv (varname)); } char * sh_get_home_dir () {