From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 81D7F38582B2; Mon, 24 Oct 2022 12:09:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 81D7F38582B2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666613380; bh=Q4Y1DMWQG+vmgOxTHxPOMtzXDG9wz08WsxUGtUmTVyw=; h=From:To:Subject:Date:From; b=q04DUOMBZOV7t+wDlpsuF0Ke+jDJYkgI4hjdmfS7rexM13DYQDntUI+2GJlUg53sF nnHfFiL5jd5IVoJPzI2GENA1dTfASlNiQHQqy/vMyChPriWGhqrRhCI0Tj0mffWbEv Tl9vZRUbILQXpLKDOf9MilcmSl0RqNGIS10II10I= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] strptime.cc(__strptime): add %q GNU quarter X-Act-Checkin: newlib-cygwin X-Git-Author: Brian Inglis X-Git-Refname: refs/heads/master X-Git-Oldrev: d6a26e542da06d0ded2b8eefbd019fc93fdec019 X-Git-Newrev: 7f7e4e5bc5e01a4dc90a10ebff8949f1c0c034dd Message-Id: <20221024120940.81D7F38582B2@sourceware.org> Date: Mon, 24 Oct 2022 12:09:40 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D7f7e4e5bc5e= 01a4dc90a10ebff8949f1c0c034dd commit 7f7e4e5bc5e01a4dc90a10ebff8949f1c0c034dd Author: Brian Inglis Date: Fri Oct 21 23:16:03 2022 -0600 strptime.cc(__strptime): add %q GNU quarter Diff: --- winsup/cygwin/libc/strptime.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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; =20 + case 'q': /* The quarter year. GNU extension. */ + LEGAL_ALT(0); + i =3D 1; + bp =3D conv_num(bp, &i, 1, 4, ALT_DIGITS); + tm->tm_mon =3D (i - 1)*3; + ymd |=3D SET_MON; + continue; + case 'S': /* The seconds. */ LEGAL_ALT(ALT_O); bp =3D conv_num(bp, &tm->tm_sec, 0, 61, ALT_DIGITS); @@ -655,7 +663,7 @@ literal: got_eoff =3D 0; continue; =20 - 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 |=3D SET_YEAR; if ((alt_format & ALT_E) && *era_info)