4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-25 16:47:20 +08:00
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 343a2a558153 ("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
..
2024-01-31 20:11:58 +01:00
2020-08-30 14:27:43 +02:00
2020-08-30 14:27:43 +02:00
2022-05-29 17:45:52 -04:00
2022-05-29 17:45:52 -04:00
2020-09-01 12:46:15 +02:00
2022-05-29 17:45:52 -04:00
2022-05-29 17:45:52 -04:00
2020-08-30 14:27:43 +02:00
2020-08-30 14:27:43 +02:00