Mail Archives: djgpp-workers/2001/06/10/13:05:15
> Date: Sun, 10 Jun 2001 10:41:56 -0400
> From: DJ Delorie <dj AT delorie DOT com>
>
> > The Posix draft standard clearly says that the result of confstr should
> > not depend on the changes to environment variables such as PATH made by
> > users or applications. I just thought that DJDIR should be treated
> > similarly.
>
> True, but in our case it depends on nothing *but* environment
> variables, so what can we do? It's going to depend on what the user
> sets for DJDIR in their environment no matter how careful we are, so
> given that, I don't think we need to be overly paranoid about what
> happens to the environment after the user is done fiddling with it.
>
> At the very least, implement confstr in C++ and use a global
> constructor to stash away the value of $DJDIR so programs that never
> call confstr aren't burdened by the code to save it.
Is code bloat and performance hit to programs which don't use confstr
the only consideration that worries you? If so, how about if the
original value of DJDIR is not stashed away by the startup code unless
confstr is linked in?
One way to do that would be to have confstr.c initialize a global
function pointer, which the startup code will call only if it is
non-NULL. That function could then be implemented in confstr.c, and
do the actual work of saving DJDIR's value.
- Raw text -