mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
Correction to:
(scm_putenv): Free temporary ptr in mingw unset. Need to ensure "e" is not unused when unsetenv is available.
This commit is contained in:
parent
c3ae8e07fc
commit
f158788fd1
1 changed files with 2 additions and 1 deletions
|
@ -1157,7 +1157,7 @@ SCM_DEFINE (scm_putenv, "putenv", 1, 0, 0,
|
|||
"The return value is unspecified.")
|
||||
#define FUNC_NAME s_scm_putenv
|
||||
{
|
||||
int rv, e;
|
||||
int rv;
|
||||
char *ptr;
|
||||
|
||||
SCM_VALIDATE_STRING (1, str);
|
||||
|
@ -1172,6 +1172,7 @@ SCM_DEFINE (scm_putenv, "putenv", 1, 0, 0,
|
|||
#else
|
||||
/* On e.g. Win32 hosts putenv() called with 'name=' removes the
|
||||
environment variable 'name'. */
|
||||
int e;
|
||||
ptr = scm_malloc (SCM_STRING_LENGTH (str) + 2);
|
||||
strncpy (ptr, SCM_STRING_CHARS (str), SCM_STRING_LENGTH (str));
|
||||
ptr[SCM_STRING_LENGTH (str)] = '=';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue