Deleted Added
full compact
shell.c (119614) shell.c (136758)
1/* $FreeBSD: head/contrib/libreadline/shell.c 119614 2003-08-31 18:29:38Z ache $ */
1/* $FreeBSD: head/contrib/libreadline/shell.c 136758 2004-10-21 20:02:02Z peter $ */
2
2/* shell.c -- readline utility functions that are normally provided by
3 bash when readline is linked as part of the shell. */
4
5/* Copyright (C) 1997 Free Software Foundation, Inc.
6
7 This file is part of the GNU Readline Library, a library for
8 reading lines of text with interactive input and history editing.
9

--- 112 unchanged lines hidden (view full) ---

122 int lines, cols;
123{
124 char *b;
125
126#if defined (HAVE_PUTENV)
127 b = (char *)xmalloc (INT_STRLEN_BOUND (int) + sizeof ("LINES=") + 1);
128 sprintf (b, "LINES=%d", lines);
129 putenv (b);
3/* shell.c -- readline utility functions that are normally provided by
4 bash when readline is linked as part of the shell. */
5
6/* Copyright (C) 1997 Free Software Foundation, Inc.
7
8 This file is part of the GNU Readline Library, a library for
9 reading lines of text with interactive input and history editing.
10

--- 112 unchanged lines hidden (view full) ---

123 int lines, cols;
124{
125 char *b;
126
127#if defined (HAVE_PUTENV)
128 b = (char *)xmalloc (INT_STRLEN_BOUND (int) + sizeof ("LINES=") + 1);
129 sprintf (b, "LINES=%d", lines);
130 putenv (b);
131
130 b = (char *)xmalloc (INT_STRLEN_BOUND (int) + sizeof ("COLUMNS=") + 1);
131 sprintf (b, "COLUMNS=%d", cols);
132 putenv (b);
133#else /* !HAVE_PUTENV */
134# if defined (HAVE_SETENV)
135 b = (char *)xmalloc (INT_STRLEN_BOUND (int) + 1);
136 sprintf (b, "%d", lines);
137 setenv ("LINES", b, 1);
132 b = (char *)xmalloc (INT_STRLEN_BOUND (int) + sizeof ("COLUMNS=") + 1);
133 sprintf (b, "COLUMNS=%d", cols);
134 putenv (b);
135#else /* !HAVE_PUTENV */
136# if defined (HAVE_SETENV)
137 b = (char *)xmalloc (INT_STRLEN_BOUND (int) + 1);
138 sprintf (b, "%d", lines);
139 setenv ("LINES", b, 1);
140 free (b);
141
138 b = (char *)xmalloc (INT_STRLEN_BOUND (int) + 1);
139 sprintf (b, "%d", cols);
140 setenv ("COLUMNS", b, 1);
142 b = (char *)xmalloc (INT_STRLEN_BOUND (int) + 1);
143 sprintf (b, "%d", cols);
144 setenv ("COLUMNS", b, 1);
145 free (b);
141# endif /* HAVE_SETENV */
142#endif /* !HAVE_PUTENV */
143}
144
145char *
146sh_get_env_value (varname)
147 const char *varname;
148{

--- 49 unchanged lines hidden ---
146# endif /* HAVE_SETENV */
147#endif /* !HAVE_PUTENV */
148}
149
150char *
151sh_get_env_value (varname)
152 const char *varname;
153{

--- 49 unchanged lines hidden ---