develooper Front page | perl.perl5.changes | Postings from February 2021

[Perl/perl5] 1c97b6: my_strftime(): Don't assume empty %p is anerror

From:
Karl Williamson via perl5-changes
Date:
February 18, 2021 01:58
Subject:
[Perl/perl5] 1c97b6: my_strftime(): Don't assume empty %p is anerror
Message ID:
Perl/perl5/push/refs/heads/blead/440416-1c97b6@github.com
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 1c97b6b159e3433bbeeb964c3f357cc57158cbb8
      https://github.com/Perl/perl5/commit/1c97b6b159e3433bbeeb964c3f357cc57158cbb8
  Author: Karl Williamson <khw@cpan.org>
  Date:   2021-02-17 (Wed, 17 Feb 2021)

  Changed paths:
    M util.c

  Log Message:
  -----------
  my_strftime(): Don't assume empty %p is an error

The strftime() format %p yields an am/pm indicator.  Many locales don't
have this distinction, and so a format containing just this specifier
will return an empty string.  Prior to this commit, that was considered
an error.  What was going on is we kept enlarging the buffer to find a
non-empty return, to no avail, and so treat it as an error.  This commit
special cases this to not make it an error.  (It's hard to imagine that
the am/pm string alone would exceed the 200 byte limit.)





nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About