g_setenv g_unsetenv



I think this would be useful.  For systems where setenv and unsetenv exist,
those can be used, and those are sane.  For systems with only putenv, these
can then be emulated.  There could even be a somewhat complex scheme to
prevent memory leaks with putenv (such as reallocating the entire environment
with g_strdup on first call to g_setenv and then g_freeing things when
overwriting).  Not sure if such a scheme would be worth it and perhaps just
accepting a leak would be ok on systems with no real setenv.

I think this should go into glib and I'd be willing to write it.  Now the
question is, would it be accepted?

George

-- 
George <jirka 5z com>
   History teaches us that men and nations behave wisely
   once they have exhausted all other alternatives.
                       -- Abba Eban, 1970




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]