From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 5681E3858C50 for ; Mon, 24 Oct 2022 12:10:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5681E3858C50 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666613417; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fuVlnPbw3icRsITXo4j0yiyMRBHff01+M2lFHsvsDsM=; b=MQ8C9LL49pgK5tbFloTTzNhLOKHTH66a4wf8opJW30wcQlpg86mY7OUpXKSVLbOMXdTR5+ VuwJSdZE7OSVbK92aYqSsKwpvmbW3BpNTNUzAJBpWpKyh6hB+73Vzdj6jgCNg4wPEQh71e eX7LP4ftalH3EOZu3IkRolCUKl9RazI= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-491-2LA5znpIO8CHlpuZARYNYg-1; Mon, 24 Oct 2022 08:10:15 -0400 X-MC-Unique: 2LA5znpIO8CHlpuZARYNYg-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B292729AA3BF for ; Mon, 24 Oct 2022 12:10:14 +0000 (UTC) Received: from calimero.vinschen.de (unknown [10.39.193.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 78B97492CA2 for ; Mon, 24 Oct 2022 12:10:14 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id 7D11EA80CFE; Mon, 24 Oct 2022 14:10:12 +0200 (CEST) Date: Mon, 24 Oct 2022 14:10:12 +0200 From: Corinna Vinschen To: newlib@sourceware.org Subject: Re: [PATCH] strptime.c(strptime_l): add %q GNU quarter Message-ID: Reply-To: newlib@sourceware.org Mail-Followup-To: newlib@sourceware.org References: <20221022051518.2761-1-Brian.Inglis@SystematicSW.ab.ca> MIME-Version: 1.0 In-Reply-To: <20221022051518.2761-1-Brian.Inglis@SystematicSW.ab.ca> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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