Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICU-13694 Use TZ=[:]<zonefile full path> in timezone detection on Linux+glibc #2213

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jungshik
Copy link
Contributor

Checklist
  • [v] Required: Issue filed: https://unicode-org.atlassian.net/browse/ICU-13694
  • [v] Required: The PR title must be prefixed with a JIRA Issue number.
  • [v] Required: The PR description must include the link to the Jira Issue, for example by completing the URL in the first checklist item
  • [v] Required: Each commit message must be prefixed with a JIRA Issue number.
  • [v] Issue accepted (done by Technical Committee after discussion)
  • Tests included, if applicable
  • [v] API docs and/or User Guide docs changed or added, if applicable

@markusicu markusicu self-assigned this Oct 6, 2022
Comment on lines +1188 to +1198
#if (defined(CHECK_LOCALTIME_LINK) && !defined(DEBUG_SKIP_LOCALTIME_LINK)) && (U_PLATFORM == U_PF_LINUX)
if (isValidOlsonID(tzid) && tzid[0] != '/')
#endif
return tzid;
#if (defined(CHECK_LOCALTIME_LINK) && !defined(DEBUG_SKIP_LOCALTIME_LINK)) && (U_PLATFORM == U_PF_LINUX)
/* Caller must handle threading issues */
else if (gTimeZoneBufferPtr != nullptr ||
extractOlsonIdFromPath(tzid, uprv_strlen(tzid))) {
return gTimeZoneBufferPtr;
}
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional: I wonder if this gives the same result but might be more readable. (FWIW, I see similarly tricky preprocessor conditions being interspersed in lines 1171-1176.)

Suggested change
#if (defined(CHECK_LOCALTIME_LINK) && !defined(DEBUG_SKIP_LOCALTIME_LINK)) && (U_PLATFORM == U_PF_LINUX)
if (isValidOlsonID(tzid) && tzid[0] != '/')
#endif
return tzid;
#if (defined(CHECK_LOCALTIME_LINK) && !defined(DEBUG_SKIP_LOCALTIME_LINK)) && (U_PLATFORM == U_PF_LINUX)
/* Caller must handle threading issues */
else if (gTimeZoneBufferPtr != nullptr ||
extractOlsonIdFromPath(tzid, uprv_strlen(tzid))) {
return gTimeZoneBufferPtr;
}
#endif
#if (defined(CHECK_LOCALTIME_LINK) && !defined(DEBUG_SKIP_LOCALTIME_LINK)) && (U_PLATFORM == U_PF_LINUX)
if (isValidOlsonID(tzid) && tzid[0] != '/') {
return tzid;
}
/* Caller must handle threading issues */
else if (gTimeZoneBufferPtr != nullptr ||
extractOlsonIdFromPath(tzid, uprv_strlen(tzid))) {
return gTimeZoneBufferPtr;
}
#else
return tzid;
#endif

@vlasky
Copy link

vlasky commented Jan 23, 2023

What's preventing this from being merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants