aboutsummaryrefslogtreecommitdiffstats
path: root/str_array.c
diff options
context:
space:
mode:
Diffstat (limited to 'str_array.c')
-rw-r--r--str_array.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/str_array.c b/str_array.c
index d832380d..c559a39a 100644
--- a/str_array.c
+++ b/str_array.c
@@ -773,9 +773,14 @@ static NODE **
env_remove(NODE *symbol, NODE *subs)
{
NODE **val = str_remove(symbol, subs);
+ char save;
- if (val != NULL)
+ if (val != NULL) {
+ save = subs->stptr[subs->stlen];
+ subs->stptr[subs->stlen] = '\0';
(void) unsetenv(subs->stptr);
+ subs->stptr[subs->stlen] = save;
+ }
return val;
}