Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Inglis <Brian.Inglis@SystematicSW.ab.ca>2022-10-22 08:16:03 +0300
committerCorinna Vinschen <corinna@vinschen.de>2022-10-24 15:09:07 +0300
commit7f7e4e5bc5e01a4dc90a10ebff8949f1c0c034dd (patch)
treeacf4dc24a3b5b66c38d6907a08bdd781f2546ff0 /winsup/cygwin/libc/strptime.cc
parentd6a26e542da06d0ded2b8eefbd019fc93fdec019 (diff)
strptime.cc(__strptime): add %q GNU quarter
Diffstat (limited to 'winsup/cygwin/libc/strptime.cc')
-rw-r--r--winsup/cygwin/libc/strptime.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/winsup/cygwin/libc/strptime.cc b/winsup/cygwin/libc/strptime.cc
index 3a9bdbb30..dc5572310 100644
--- a/winsup/cygwin/libc/strptime.cc
+++ b/winsup/cygwin/libc/strptime.cc
@@ -570,6 +570,14 @@ literal:
LEGAL_ALT(0);
continue;
+ case 'q': /* The quarter year. GNU extension. */
+ LEGAL_ALT(0);
+ i = 1;
+ bp = conv_num(bp, &i, 1, 4, ALT_DIGITS);
+ tm->tm_mon = (i - 1)*3;
+ ymd |= SET_MON;
+ continue;
+
case 'S': /* The seconds. */
LEGAL_ALT(ALT_O);
bp = conv_num(bp, &tm->tm_sec, 0, 61, ALT_DIGITS);
@@ -655,7 +663,7 @@ literal:
got_eoff = 0;
continue;
- case 'y': /* The year within 100 years of the epoch. */
+ case 'y': /* The year within 100 years of the century or era. */
/* LEGAL_ALT(ALT_E | ALT_O); */
ymd |= SET_YEAR;
if ((alt_format & ALT_E) && *era_info)