summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-09-12 05:37:38 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-09-12 05:37:38 +0000
commitfbcc6dea0c86e7e4d087f1d4b2de19b211d16647 (patch)
tree68bde87194755712893e5efa4d7f9d2f5312df10 /hash.c
parent9d823983dc3e88cb7775c78908a4bb5133ad88ac (diff)
matz: 1.6.0 final (hopufully)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hash.c b/hash.c
index 3ff58cc..62d6145 100644
--- a/hash.c
+++ b/hash.c
@@ -1055,7 +1055,8 @@ ruby_setenv(name, value)
environ = tmpenv; /* tell exec where it is now */
}
if (!value) {
- free(environ[i]);
+ if (environ[i] != origenviron[i])
+ free(environ[i]);
while (environ[i]) {
environ[i] = environ[i+1];
i++;
@@ -1067,7 +1068,8 @@ ruby_setenv(name, value)
environ[i+1] = 0; /* make sure it's null terminated */
}
else {
- free(environ[i]);
+ if (environ[i] != origenviron[i])
+ free(environ[i]);
}
environ[i] = ALLOC_N(char, strlen(name) + strlen(value) + 2);
#ifndef MSDOS