mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: Petr Pisar <petr.pisar@atlas.cz>
Cc: musl@lists.openwall.com
Subject: Re: [musl] strptime(s, "%Y-%j", &tm) does not update month and day
Date: Sat, 11 May 2024 17:28:54 -0400	[thread overview]
Message-ID: <20240511212853.GS10433@brightrain.aerifal.cx> (raw)
In-Reply-To: <Zj-Ny2wTG_PcMCd7@album.bayer.uni.cx>

On Sat, May 11, 2024 at 05:24:59PM +0200, Petr Pisar wrote:
> Hello,
> 
> When debugging a libisds test failure with musl-1.2.5
> <https://bugs.gentoo.org/show_bug.cgi?id=928107>, I found that musl's
> strptime() does not handle "%Y-%j" properly. It accepts the format, it parses
> the input string, it returns a correct pointer past the input string, but it
> does not update tm.tm_mon and tm.tm_mday fileds of the third argument.

This is behaving as specified. Previously, the behavior was
unspecified. POSIX has amended it for future issues as the resolution
of https://austingroupbugs.net/view.php?id=1727 to read:

    The tm_yday member of the tm structure pointed to by tm shall be
    set to this number minus 1.

strptime generally does not behave like mktime, doing
normalizations/conversions.

Rich

  reply	other threads:[~2024-05-11 21:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-11 15:24 Petr Pisar
2024-05-11 21:28 ` Rich Felker [this message]
2024-05-12  7:54   ` Petr Pisar
2024-05-13 12:18     ` Rich Felker
2024-05-13 21:18       ` Thorsten Glaser

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=20240511212853.GS10433@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    --cc=petr.pisar@atlas.cz \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).