1
0
mirror of https://github.com/adtools/clib2.git synced 2025-12-08 14:59:05 +00:00

- Moved the environment variable cleanup code into a destructor function.

- Fixed a typo in the hstrerror() function.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14782 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
Olaf Barthel
2004-12-19 16:42:51 +00:00
parent 7b67ccdec1
commit 76c68da3a5
6 changed files with 42 additions and 34 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: stdlib_setenv.c,v 1.2 2004-08-07 09:15:32 obarthel Exp $
* $Id: stdlib_setenv.c,v 1.3 2004-12-19 16:42:51 obarthel Exp $
*
* :ts=4
*
@ -53,7 +53,36 @@
/****************************************************************************/
struct LocalVariable * __lv_root;
struct LocalVariable
{
struct LocalVariable * lv_Next;
char * lv_Name;
};
/****************************************************************************/
STATIC struct LocalVariable * __lv_root;
/****************************************************************************/
CLIB_DESTRUCTOR(__setenv_exit)
{
ENTER();
/* Now for the local variables that may still be set. */
if(__lv_root != NULL)
{
do
{
D(("deleting variable '%s'",__lv_root->lv_Name));
DeleteVar(__lv_root->lv_Name,0);
}
while((__lv_root = __lv_root->lv_Next) != NULL);
}
LEAVE();
}
/****************************************************************************/