gnats-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changes to gnats/libiberty/setenv.c


From: Milan Zamazal
Subject: Changes to gnats/libiberty/setenv.c
Date: Mon, 10 Dec 2001 18:04:30 -0500

Index: gnats/libiberty/setenv.c
diff -c gnats/libiberty/setenv.c:1.1 gnats/libiberty/setenv.c:1.2
*** gnats/libiberty/setenv.c:1.1        Tue Oct 26 03:10:16 1999
--- gnats/libiberty/setenv.c    Mon Dec 10 18:03:26 2001
***************
*** 21,26 ****
--- 21,28 ----
  #endif
  
  #include "ansidecl.h"
+ #include <sys/types.h> /* For `size_t' */
+ #include <stdio.h>     /* For `NULL' */
  
  #include <errno.h>
  #if !defined(errno) && !defined(HAVE_ERRNO_DECL)
***************
*** 30,38 ****
  
  #if HAVE_STDLIB_H
  # include <stdlib.h>
- #else
- #include <sys/types.h> /* For `size_t' */
- #include <stdio.h>     /* For `NULL' */
  #endif
  #if HAVE_STRING_H
  # include <string.h>
--- 32,37 ----
***************
*** 64,70 ****
       const char *value;
       int replace;
  {
!   register char **ep;
    register size_t size;
    const size_t namelen = strlen (name);
    const size_t vallen = strlen (value) + 1;
--- 63,69 ----
       const char *value;
       int replace;
  {
!   register char **ep = 0;
    register size_t size;
    const size_t namelen = strlen (name);
    const size_t vallen = strlen (value) + 1;
***************
*** 73,83 ****
  
    size = 0;
    if (__environ != NULL)
!     for (ep = __environ; *ep != NULL; ++ep)
!       if (!strncmp (*ep, name, namelen) && (*ep)[namelen] == '=')
!       break;
!       else
!       ++size;
  
    if (__environ == NULL || *ep == NULL)
      {
--- 72,84 ----
  
    size = 0;
    if (__environ != NULL)
!     {
!       for (ep = __environ; *ep != NULL; ++ep)
!       if (!strncmp (*ep, name, namelen) && (*ep)[namelen] == '=')
!         break;
!       else
!         ++size;
!     }
  
    if (__environ == NULL || *ep == NULL)
      {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]