Skip to content

Commit 89ff2e6

Browse files
committed
Look for abbreviations when creating time zones.
In the case the code ends up in the fallback that uses localtime_r (in Unixes), the returned value in tm_zone is an abbreviation, but the code that created the CFTimeZoneRef was not looking for abbreviations. This code was hit in Android all the time (since it doesn't have an Olson TZ file structure), but I didn't realized because my test machine were using UTC instead of an actual time zone.
1 parent a29049f commit 89ff2e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CoreFoundation/NumberDate.subproj/CFTimeZone.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ static CFTimeZoneRef __CFTimeZoneCreateSystem(void) {
889889
}
890890
#endif
891891
if (name) {
892-
result = CFTimeZoneCreateWithName(kCFAllocatorSystemDefault, name, false);
892+
result = CFTimeZoneCreateWithName(kCFAllocatorSystemDefault, name, true);
893893
CFRelease(name);
894894
if (result) return result;
895895
}

0 commit comments

Comments
 (0)