Mail Archives: djgpp-workers/1999/08/08/16:24:56
> The machinery to do such caching is already in place: see the
> variable `__environ_changed'. `_use_lfn' actually uses it.
>
> Assuming that there is some case where `getenv' is called a lot from
> `_put_path2', and where this caching makes a difference, I don't see
> any reasons not to add this feature. Please send in the diffs.
> (Don't forget to use `__bss_count' to invalidate the cache when the
> program is restarted, for Emacs' sake.)
>
There's one change to getenv I think should be made:
*** src/libc/ansi/stdlib/getenv.c.orig Fri Nov 24 22:21:18 1995
--- src/libc/ansi/stdlib/getenv.c Sun Aug 8 16:11:28 1999
***************
*** 1,3 ****
--- 1,4 ----
+ /* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#include <stdlib.h>
#include <string.h>
*************** getenv(const char *name)
*** 9,15 ****
{
int i;
! if (environ == 0)
return 0;
for (i=0; environ[i]; i++)
--- 10,16 ----
{
int i;
! if (environ == 0 || name == 0)
return 0;
for (i=0; environ[i]; i++)
As for the other change, I'll do some testing and see if the change is worth making.
Mark
---
Mark Elbrecht, snowball3 AT bigfoot DOT com
http://snowball.frogspace.net/
- Raw text -