summaryrefslogtreecommitdiffstats
path: root/contrib/libreadline/shell.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libreadline/shell.c')
-rw-r--r--contrib/libreadline/shell.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/libreadline/shell.c b/contrib/libreadline/shell.c
index 88b15c5..e2a01a4 100644
--- a/contrib/libreadline/shell.c
+++ b/contrib/libreadline/shell.c
@@ -1,4 +1,5 @@
/* $FreeBSD$ */
+
/* shell.c -- readline utility functions that are normally provided by
bash when readline is linked as part of the shell. */
@@ -127,6 +128,7 @@ sh_set_lines_and_columns (lines, cols)
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);
@@ -135,9 +137,12 @@ sh_set_lines_and_columns (lines, cols)
b = (char *)xmalloc (INT_STRLEN_BOUND (int) + 1);
sprintf (b, "%d", lines);
setenv ("LINES", b, 1);
+ free (b);
+
b = (char *)xmalloc (INT_STRLEN_BOUND (int) + 1);
sprintf (b, "%d", cols);
setenv ("COLUMNS", b, 1);
+ free (b);
# endif /* HAVE_SETENV */
#endif /* !HAVE_PUTENV */
}
OpenPOWER on IntegriCloud