From: Corinna Vinschen <vinschen@redhat.com>
To: newlib@sourceware.org
Subject: Re: [PATCH] strptime.c(strptime_l): add %q GNU quarter
Date: Mon, 24 Oct 2022 14:10:12 +0200 [thread overview]
Message-ID: <Y1aApF3JrjCE94mw@calimero.vinschen.de> (raw)
In-Reply-To: <20221022051518.2761-1-Brian.Inglis@SystematicSW.ab.ca>
On Oct 21 23:15, Brian Inglis wrote:
> ---
> newlib/libc/time/strptime.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/newlib/libc/time/strptime.c b/newlib/libc/time/strptime.c
> index 12b2ef4695de..6220ff73ad27 100644
> --- a/newlib/libc/time/strptime.c
> +++ b/newlib/libc/time/strptime.c
> @@ -1,5 +1,5 @@
> /*
> - * Copyright (c) 1999 Kungliga Tekniska H?gskolan
> + * Copyright (c) 1999 Kungliga Tekniska Högskolan
> * (Royal Institute of Technology, Stockholm, Sweden).
> * All rights reserved.
> *
> @@ -298,6 +298,14 @@ strptime_l (const char *buf, const char *format, struct tm *timeptr,
> } else
> timeptr->tm_hour += 12;
> break;
> + case 'q' : /* quarter year - GNU extension */
> + ret = strtol_l (buf, &s, 10, locale);
> + if (s == buf)
> + return NULL;
> + timeptr->tm_mon = (ret - 1)*3;
> + buf = s;
> + ymd |= SET_MON;
> + break;
> case 'r' : /* %I:%M:%S %p */
> s = strptime_l (buf, _ctloc (ampm_fmt), timeptr, locale);
> if (s == NULL)
Pushed.
Thanks,
Corinna
prev parent reply other threads:[~2022-10-24 12:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-22 5:15 Brian Inglis
2022-10-24 12:10 ` Corinna Vinschen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y1aApF3JrjCE94mw@calimero.vinschen.de \
--to=vinschen@redhat.com \
--cc=newlib@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).