From: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
To: Stanley Lancaster <lancasterharp@gmail.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH] %Z [PATCH v6]
Date: Wed, 2 Aug 2023 14:16:54 -0300 [thread overview]
Message-ID: <0f5edfc1-73b9-4535-bf86-4417d39d65aa@linaro.org> (raw)
In-Reply-To: <20230731142420.23766-1-lancasterharp@gmail.com>
Add a proper subject on each new version, the initial one you use should be
ok.
On 31/07/23 11:24, Stanley Lancaster via Libc-alpha wrote:
> ---
> time/strptime_l.c | 19 ++++++++++++++-----
> time/tst-strptime.c | 2 ++
> 2 files changed, 16 insertions(+), 5 deletions(-)
>
> diff --git a/time/strptime_l.c b/time/strptime_l.c
> index 85c3249fcc..1b84065c19 100644
> --- a/time/strptime_l.c
> +++ b/time/strptime_l.c
> @@ -770,11 +770,20 @@ __strptime_internal (const char *rp, const char *fmt, struct tm *tmp,
> break;
> case 'Z':
> /* Read timezone but perform no conversion. */
> - while (ISSPACE (*rp))
> - rp++;
> - while (!ISSPACE (*rp) && *rp != '\0')
> - rp++;
> - break;
> + {
> + while (ISSPACE (*rp))
> + rp++;
> + /* Read timezone but perform no conversion. */
> + /* we recognize the format [-+a-zA-Z0-9]{3,} */
> + const char* start_rp = rp;
> +
> + while ((*rp >= 'A' && *rp <= 'Z') ||
> + (*rp >= 'a' && *rp <= 'z') ||
> + (*rp >= '0' && *rp <= '9'))
> + rp++;
> + if (start_rp+3 < rp)
> + return NULL;
Indentation is off here, along with style. It should be like:
{
while (ISSPACE (*rp))
rp++;
const char* start_rp = rp;
while ((*rp >= 'A' && *rp <= 'Z')
|| (*rp >= 'a' && *rp <= 'z')
|| (*rp >= 'a' && *rp <= 'z'))
rp++;
if (start_rp+3 < rp)
return NULL;
}
break;
> + }
Missing break here, I am not sure it haven't triggered any regression failure
on your side. At least aarch64 bot did trigger the CI failure.
> case 'z':
> /* We recognize four formats:
> 1. Two digits specify hours.
> diff --git a/time/tst-strptime.c b/time/tst-strptime.c
> index 3dae9e0594..40145cb109 100644
> --- a/time/tst-strptime.c
> +++ b/time/tst-strptime.c
> @@ -48,6 +48,8 @@ static const struct
> 6, 0, 0, 1 },
> { "en_US.ISO-8859-1", "2000-01-01 08:12:21 PM", "%Y-%m-%d %I:%M:%S %p",
> 6, 0, 0, 1 },
> + { "en_US.ISO-8859-1", "2000-01-01 08:12:21 AM CST/", "%Y-%m-%d %I:%M:%S %p %Z/",
Extra end of line whitespace.
> + 6, 0, 0, 1},
> { "ja_JP.EUC-JP", "2001 20 \xb7\xee", "%Y %U %a", 1, 140, 4, 21 },
> { "ja_JP.EUC-JP", "2001 21 \xb7\xee", "%Y %W %a", 1, 140, 4, 21 },
> /* Most of the languages do not need the declension of the month names
next prev parent reply other threads:[~2023-08-02 17:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-31 14:24 Stanley Lancaster
2023-08-02 17:16 ` Adhemerval Zanella Netto [this message]
2023-08-14 13:48 ` Carlos O'Donell
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=0f5edfc1-73b9-4535-bf86-4417d39d65aa@linaro.org \
--to=adhemerval.zanella@linaro.org \
--cc=lancasterharp@gmail.com \
--cc=libc-alpha@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).