mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-10 15:42:14 +00:00
parent
6a4ae3b95f
commit
ca631eaa26
2 changed files with 18 additions and 6 deletions
|
@ -1175,6 +1175,21 @@ uprv_tzname(int n)
|
|||
if (ret != nullptr && uprv_strcmp(TZDEFAULT, gTimeZoneBuffer) != 0) {
|
||||
int32_t tzZoneInfoTailLen = uprv_strlen(TZZONEINFOTAIL);
|
||||
const char *tzZoneInfoTailPtr = uprv_strstr(gTimeZoneBuffer, TZZONEINFOTAIL);
|
||||
// MacOS14 has the realpath as something like
|
||||
// /usr/share/zoneinfo.default/Australia/Melbourne
|
||||
// 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
|
||||
// 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;
|
||||
tzZoneInfoTailPtr = uprv_strstr(gTimeZoneBuffer, TZZONEINFOTAIL);
|
||||
}
|
||||
}
|
||||
if (tzZoneInfoTailPtr != nullptr) {
|
||||
tzZoneInfoTailPtr += tzZoneInfoTailLen;
|
||||
skipZoneIDPrefix(&tzZoneInfoTailPtr);
|
||||
|
|
|
@ -22,7 +22,7 @@ system_symbols:
|
|||
exp_and_tanhf
|
||||
stdlib_qsort
|
||||
system_locale
|
||||
stdio_input stdio_output file_io realpath_function dir_io mmap_functions dlfcn
|
||||
stdio_input stdio_output file_io dir_io mmap_functions dlfcn
|
||||
# C++
|
||||
cplusplus iostream
|
||||
std_mutex
|
||||
|
@ -110,11 +110,8 @@ group: file_io
|
|||
# Additional symbols in an optimized build.
|
||||
__xstat
|
||||
|
||||
group: realpath_function
|
||||
realpath # putil.cpp uprv_tzname() calls this in a hack to get the time zone name
|
||||
|
||||
group: dir_io
|
||||
opendir closedir readdir # for a hack to get the time zone name
|
||||
opendir closedir readdir readlink realpath # for a hack to get the time zone name
|
||||
|
||||
group: mmap_functions # for memory-mapped data loading
|
||||
mmap munmap
|
||||
|
@ -868,7 +865,7 @@ group: platform
|
|||
PIC system_misc system_debug malloc_functions ubsan
|
||||
c_strings c_string_formatting
|
||||
floating_point system_locale
|
||||
stdio_input realpath_function dir_io
|
||||
stdio_input dir_io
|
||||
dlfcn # Move related code into icuplug.c?
|
||||
cplusplus
|
||||
std_mutex
|
||||
|
|
Loading…
Add table
Reference in a new issue