aboutsummaryrefslogtreecommitdiff
path: root/stdlib/setenv.c
diff options
context:
space:
mode:
authorYvan Roux <yvan.roux@linaro.org>2016-04-15 13:29:26 +0200
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2016-04-20 10:43:40 +0100
commit5769d5d17cdb4770f1e08167b76c1684ad4e1f73 (patch)
tree5ab6a86e988ad0616fc051140c49f3af399084ff /stdlib/setenv.c
parentf1e182acaaa84e844eb96462a92ba532e1c1fff4 (diff)
downloadglibc-5769d5d17cdb4770f1e08167b76c1684ad4e1f73.zip
glibc-5769d5d17cdb4770f1e08167b76c1684ad4e1f73.tar.gz
glibc-5769d5d17cdb4770f1e08167b76c1684ad4e1f73.tar.bz2
Suppress GCC 6 warning about ambiguous 'else' with -Wparentheses
(cherry picked from commit df1cf48777fe4cd81ad7fb09ecbe5b31432b7c1c)
Diffstat (limited to 'stdlib/setenv.c')
-rw-r--r--stdlib/setenv.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/stdlib/setenv.c b/stdlib/setenv.c
index da61ee0..e66045f 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;