]> sourceware.org Git - newlib-cygwin.git/commitdiff
strptime.cc(__strptime): add %q GNU quarter
authorBrian Inglis <Brian.Inglis@SystematicSW.ab.ca>
Sat, 22 Oct 2022 05:16:03 +0000 (23:16 -0600)
committerCorinna Vinschen <corinna@vinschen.de>
Mon, 24 Oct 2022 12:09:07 +0000 (14:09 +0200)
winsup/cygwin/libc/strptime.cc

index 3a9bdbb300d4abea88b4b89dfbf312332a676098..dc557231012db007cfbfa3aea4f3f89e2d2c2d7f 100644 (file)
@@ -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)
This page took 0.030887 seconds and 5 git commands to generate.