Skip to content

Commit

Permalink
Update icu4c/source/common/putil.cpp
Browse files Browse the repository at this point in the history
Co-authored-by: Markus Scherer <[email protected]>
  • Loading branch information
FrankYFTang and markusicu authored Oct 12, 2023
1 parent ec07e58 commit 119a18a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion icu4c/source/common/putil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,10 @@ uprv_tzname(int n)
// which will not have "/zoneinfo/" in the path.
// Therefore if we fail, we fall back to read the link which is
// /var/db/timezone/zoneinfo/Australia/Melbourne
if (tzZoneInfoTailPtr == nullptr) {
// We also fall back to reading the link if the realpath leads to something like
// /usr/share/zoneinfo/posixrules
if (tzZoneInfoTailPtr == nullptr ||
uprv_strcmp(tzZoneInfoTailPtr + tzZoneInfoTailLen, "posixrules") == 0) {
ssize_t size = readlink(TZDEFAULT, gTimeZoneBuffer, sizeof(gTimeZoneBuffer)-1);
if (size > 0) {
gTimeZoneBuffer[size] = 0;
Expand Down

0 comments on commit 119a18a

Please sign in to comment.