Mail Archives: djgpp-workers/2007/08/02/13:24:11
Hi,
I suspect there's a small bug in tzset(). When I do
putenv("TZ=...");
tzset();
unsetenv("TZ");
tzset();
the second tzset() call does nothing (and thus the obsolete TZ setting
remains valid, which is bad). I think this behavior was introduced with this
optimization:
http://www.delorie.com/bin/cvsweb.cgi/djgpp/src/libc/ansi/time/ctime.c.diff?r1=1.8&r2=1.9
and hopefully would be fixed with this change:
--- a/src/libc/ansi/time/ctime.c 2002-11-30 06:35:58.000000000 +0100
+++ b/src/libc/ansi/time/ctime.c 2007-08-02 16:25:40.000000000 +0200
@@ -929,7 +929,7 @@
name = getenv("TZ");
/* Use stricmp, since if TZ points to a file name, we need to be
case-insensitive. */
- if (lcl_is_set > 0 && (name == NULL || stricmp(name, lcl_tzstr) == 0))
+ if (lcl_is_set > 0 && stricmp(name ? name : "", lcl_tzstr) == 0)
return;
/* On to some *real* work... */
@@ -937,6 +937,7 @@
{
tzsetwall();
lcl_is_set = 1;
+ lcl_tzstr[0] = 0;
return;
}
if (strlen(name) < sizeof(lcl_tzstr))
if it's right and fits your taste :).
Sorry if I'm wrong.
Regards,
--
Egon Eckert, Heaven Industries, s.r.o.
E-mail: egon AT heaven DOT industries DOT cz
EARTH
smog | bricks
AIR -- mud -- FIRE
soda water | tequila
WATER
-- with thanks to fortune
- Raw text -