From df1cf48777fe4cd81ad7fb09ecbe5b31432b7c1c Mon Sep 17 00:00:00 2001 From: Yvan Roux Date: Fri, 15 Apr 2016 13:29:26 +0200 Subject: Suppress GCC 6 warning about ambiguous 'else' with -Wparentheses --- stdlib/setenv.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'stdlib') diff --git a/stdlib/setenv.c b/stdlib/setenv.c index da61ee0720..e66045f7d8 100644 --- a/stdlib/setenv.c +++ b/stdlib/setenv.c @@ -278,18 +278,20 @@ unsetenv (const char *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; -- cgit v1.2.3