diff options
Diffstat (limited to 'stdlib')
-rw-r--r-- | stdlib/setenv.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/stdlib/setenv.c b/stdlib/setenv.c index b60c4f0..84cec79 100644 --- a/stdlib/setenv.c +++ b/stdlib/setenv.c @@ -269,18 +269,20 @@ unsetenv (name) ep = __environ; if (ep != NULL) while (*ep != NULL) - if (!strncmp (*ep, name, len) && (*ep)[len] == '=') - { - /* Found it. Remove this pointer by moving later ones back. */ - char **dp = ep; - - do - dp[0] = dp[1]; - while (*dp++); - /* Continue the loop in case NAME appears again. */ - } - else - ++ep; + { + if (!strncmp (*ep, name, len) && (*ep)[len] == '=') + { + /* Found it. Remove this pointer by moving later ones back. */ + char **dp = ep; + + do + dp[0] = dp[1]; + while (*dp++); + /* Continue the loop in case NAME appears again. */ + } + else + ++ep; + } UNLOCK; |