/[gnats]/gnats/gnats/misc.c
ViewVC logotype

Diff of /gnats/gnats/misc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.42 by chewie, Thu Feb 24 21:21:22 2005 UTC revision 1.43 by chewie, Thu Aug 25 03:31:16 2005 UTC
# Line 944  basename (name) Line 944  basename (name)
944    return (char *) base;    return (char *) base;
945  }  }
946  #endif /* HAVE_BASENAME */  #endif /* HAVE_BASENAME */
947    
948    #ifndef HAVE_UNSETENV
949    #define __environ       environ
950    extern char **environ;
951    
952    void
953    unsetenv (name)
954         const char *name;
955    {
956      const size_t len = strlen (name);
957      char **ep;
958    
959      for (ep = __environ; *ep; ++ep)
960        if (!strncmp (*ep, name, len) && (*ep)[len] == '=')
961          {
962            /* Found it.  Remove this pointer by moving later ones back.  */
963            char **dp = ep;
964            do
965              dp[0] = dp[1];
966            while (*dp++);
967            /* Continue the loop in case NAME appears again.  */
968          }
969    
970    }
971    #endif /* !HAVE_UNSETENV */

Legend:
Removed from v.1.42  
changed lines
  Added in v.1.43

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26