Nice patch, what I don't understand is why you did add an #else branch. If tzset() fails we should still use the TZ environment variable.This patches NSTimeZone to use a more standard (Posix?) method of finding the time zone info that's already set on the computer. I think many people could avoid having to set the "Local Time Zone" default.
Fred
+#if HAVE_TZSET
+ if (localZoneString == nil)
+ {
+ /*
+ * Try to get timezone from tzset and tzname
+ */
+ extern char *tzname[2];
+ tzset();
+ if (tzname[0] != NULL && *tzname[0] != '\0')
+ localZoneString = [NSString stringWithCString: tzname[0]];
+ }
+#else
if (localZoneString == nil)
{
/*
@@ -1131,6 +1144,7 @@ static NSMapTable *absolutes = 0;
localZoneString = [[[NSProcessInfo processInfo]
environment] objectForKey: @"TZ"];
}
+#endif
if (localZoneString != nil)
{
zone = [defaultPlaceholderTimeZone initWithName: localZoneString];
_______________________________________________ Bug-gnustep mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-gnustep
