mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
libc/time: Fix POSIX timezone string parsing.
When loading a zoneinfo file fails, parse a non-colon-prefixed TZ value as a POSIX timezone string. Treat a successful tzparse() result as success while preserving the leading-colon file-only behavior. Assisted-by: Codex:gpt-5.6 Sol Signed-off-by: hanzhijian <hanzhijian@zepp.com>
This commit is contained in:
parent
8c94a72657
commit
5f0c1c8d10
1 changed files with 2 additions and 2 deletions
|
|
@ -2751,8 +2751,8 @@ static int zoneinit(FAR const char *name)
|
|||
int err;
|
||||
|
||||
err = tzload(name, g_lcl_ptr, TRUE);
|
||||
if (err != 0 && name != NULL && name[0] == ':' &&
|
||||
tzparse(name, g_lcl_ptr, NULL) != 0)
|
||||
if (err != 0 && name != NULL && name[0] != ':' &&
|
||||
tzparse(name, g_lcl_ptr, NULL) == 0)
|
||||
{
|
||||
err = 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue