1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-17 18:21:03 +03:00

Suppress GCC 6 warning about ambiguous 'else' with -Wparentheses

This commit is contained in:
Yvan Roux
2016-04-15 13:29:26 +02:00
committed by Florian Weimer
parent f8da6e93a6
commit df1cf48777
3 changed files with 29 additions and 20 deletions

View File

@ -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;
{
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;
do
dp[0] = dp[1];
while (*dp++);
/* Continue the loop in case NAME appears again. */
}
else
++ep;
}
UNLOCK;