aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2016-03-28 16:31:04 +0000
committerTatsuya Kinoshita <tats@debian.org>2016-03-29 10:15:29 +0000
commitb5b25b5904027a589010ab4cfbddac042ac01eb4 (patch)
treebdda3638a72f7e3cf7d0e108935f2931e7b78b6c
parentFix realloc mistake for DrawImage (diff)
downloadw3m-b5b25b5904027a589010ab4cfbddac042ac01eb4.tar.gz
w3m-b5b25b5904027a589010ab4cfbddac042ac01eb4.zip
Fix uninitialized variable when not HAVE_PUTENV
Diffstat (limited to '')
-rw-r--r--local.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/local.c b/local.c
index 202e9c4..46ac579 100644
--- a/local.c
+++ b/local.c
@@ -213,18 +213,17 @@ set_environ(char *var, char *value)
if (var != NULL && value != NULL)
setenv(var, value, 1);
#else /* not HAVE_SETENV */
-#ifdef HAVE_PUTENV
static Hash_sv *env_hash = NULL;
Str tmp = Strnew_m_charp(var, "=", value, NULL);
if (env_hash == NULL)
env_hash = newHash_sv(20);
putHash_sv(env_hash, var, (void *)tmp->ptr);
+#ifdef HAVE_PUTENV
putenv(tmp->ptr);
#else /* not HAVE_PUTENV */
extern char **environ;
char **ne;
- char *p;
int i, l, el;
char **e, **newenv;
@@ -251,7 +250,7 @@ set_environ(char *var, char *value)
if (newenv == NULL)
return;
for (e = environ, ne = newenv; *e != NULL; *(ne++) = *(e++)) ;
- *(ne++) = p;
+ *(ne++) = tmp->ptr;
*ne = NULL;
environ = newenv;
#endif /* not HAVE_PUTENV */