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