]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - stdlib/setenv.c
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / stdlib / setenv.c
index 4064a52651079e5afcb2054cfed82466291c6751..2a80406870cccf89c83380f6f859a2ba8c665815 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -13,7 +13,7 @@
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <https://www.gnu.org/licenses/>.  */
 
 #if HAVE_CONFIG_H
 # include <config.h>
    there seems to be no way to pacify GCC selectively, only for the
    place where it's needed.  Do not use DIAG_IGNORE_NEEDS_COMMENT
    here, as it's not defined yet.  */
-#if ((__GNUC__ << 16) + __GNUC_MINOR__) >= ((4 << 16) + 7)
-# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
-#else
-# pragma GCC diagnostic ignored "-Wuninitialized"
-#endif
+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
 
 #include <errno.h>
 #if !_LIBC
@@ -282,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;