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

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

Karl Williamson via perl5-changes
February 18, 2021 01:58
[Perl/perl5] 1c97b6: my_strftime(): Don't assume empty %p is anerror
Message ID:
  Branch: refs/heads/blead
  Commit: 1c97b6b159e3433bbeeb964c3f357cc57158cbb8
  Author: Karl Williamson <>
  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.) Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About