mirror of
https://github.com/apache/nuttx.git
synced 2026-10-06 22:05:21 +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
394326b98d
commit
04ef9357e1
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