Files
vim/runtime
Yasuhiro Matsumoto 036e40e6d8 patch 9.2.0398: MS-Windows: missing strptime() support
Problem:  MS-Windows: missing strptime() support
Solution: Port NetBSD's strptime fallback to Vim
          (Yasuhiro Matsumoto).

The MSVC and MinGW C runtimes do not provide strptime(), so the
strptime() builtin was unavailable on Windows.  Port NetBSD's
lib/libc/time/strptime.c (rev 1.67) and compile it into the Windows
builds.  The BSD 2-clause notice from the original is preserved in the
file.  Windows-specific adjustments: English-only locale tables, the
fromzone()/tzalloc() path is stubbed out (no IANA tzfile loader on
Windows), and tm_gmtoff / tm_zone stores are elided.

Also call tzset() before mktime() in f_strptime() so changes to \$TZ
are honored.

Skip the POSIX DST TZ assertion in Test_strptime() on MS-Windows since
the CRT tzset() does not parse POSIX TZ strings with DST rules.

closes: #20054

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-04-26 17:31:41 +00:00
..