newlib-cygwin/winsup/cygwin/libc
Corinna Vinschen 585855eef8 Cygwin: strptime: fix am/pm handling
The %p format specifier is handled immediately.  It requires
that tm_hour is already set.  This falls flat in case the am/pm
marker preceeds the time specification.  Locales with am/pm
marker preceeding time spec by default exist (e. g. ko_KR).

Also, the code expects that tm_hour might be set to an invalid
value because the %p specifier is used in conjunction with %H.
But this usage is invalid in itself and now catched as error
condition after commit 343a2a5581 ("Cygwin: strptime: make
sure to fail on invalid input digits").

Change the %H/%I/%p handling according to GLibC, i. e.

- fix tm_hour for pm only if the time value has been specified
  as 12 hour time %I, and

- perform the fixup only after the entire input has been scanned.
  This decouples the fixup from the %p position relativ to %I.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-02-21 19:54:20 +01:00
..
arc4random_stir.c
base64.c Cygwin: Add 'fallthrough' pseudo keyword for switch/case use 2020-08-05 21:58:22 +02:00
bsdlib.cc Cygwin: implement setproctitle 2024-01-31 20:11:58 +01:00
call_once.c Cygwin: Add C11 threads API 2020-08-30 14:27:43 +02:00
cnd.c Cygwin: Add C11 threads API 2020-08-30 14:27:43 +02:00
fnmatch.c Cygwin: fnmatch: fix range comparison in C locale 2023-07-27 21:57:49 +02:00
fts.c Cygwin: simplify some function names 2022-05-29 17:45:52 -04:00
ftw.c Cygwin: Add 'fallthrough' pseudo keyword for switch/case use 2020-08-05 21:58:22 +02:00
getentropy.cc
getopt.c
inet_addr.c
inet_network.c
minires-os-if.c Cygwin: resolver: cygwin_query() skip response header on internal error 2022-01-19 15:26:14 +01:00
minires.c Cygwin: simplify some function names 2022-05-29 17:45:52 -04:00
minires.h
msgcat.c Cygwin: Add 'fallthrough' pseudo keyword for switch/case use 2020-08-05 21:58:22 +02:00
mtx.c Cygwin: mtx_init: drop glibc workaround 2020-09-01 12:46:15 +02:00
nftw.c Cygwin: Add 'fallthrough' pseudo keyword for switch/case use 2020-08-05 21:58:22 +02:00
rcmd.cc Cygwin: simplify some function names 2022-05-29 17:45:52 -04:00
rexec.cc Cygwin: simplify some function names 2022-05-29 17:45:52 -04:00
strfmon.c Cygwin: fix formatting: drop trailing whitespace 2020-03-11 13:45:58 +01:00
strptime.cc Cygwin: strptime: fix am/pm handling 2024-02-21 19:54:20 +01:00
thrd.c Cygwin: Add C11 threads API 2020-08-30 14:27:43 +02:00
tss.c Cygwin: Add C11 threads API 2020-08-30 14:27:43 +02:00
xsique.cc