From de4a40d07fd7bed8f57a49a22bf8c110751e80d6 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 29 Jul 1999 20:40:05 +0000 Subject: Update. * sysdeps/generic/setenv.c: Move setenv code in new function __add_to_environ. Add new parameter specifying already constructed string for the environment. (setenv): Call __add_to_environ with new parameter set to NULL. (unsetenv): Really test all elements for duplicated name. Missed those cases where the two are following each other. * sysdeps/generic/putenv.c: Use __add_to_environ instead of setenv. * include/stdlib.h: Add prototype of __add_to_environ. * stdlib/tst-environ.c: New file. --- sysdeps/generic/putenv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sysdeps/generic/putenv.c') diff --git a/sysdeps/generic/putenv.c b/sysdeps/generic/putenv.c index 3fcd5f93a8..75fafad06d 100644 --- a/sysdeps/generic/putenv.c +++ b/sysdeps/generic/putenv.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 94, 95, 96, 97, 98 Free Software Foundation, Inc. +/* Copyright (C) 1991, 94, 95, 96, 97, 98, 99 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 @@ -64,7 +64,7 @@ putenv (string) memcpy (name, string, name_end - string); name[name_end - string] = '\0'; #endif - return __setenv (name, name_end + 1, 1); + return __add_to_environ (name, NULL, string, 1); } __unsetenv (string); -- cgit 1.4.1