[Bug time/26226] New: strftime format string for 'day of the week' does not recognize justification

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug time/26226] New: strftime format string for 'day of the week' does not recognize justification

Sourceware - glibc-bugs mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=26226

            Bug ID: 26226
           Summary: strftime format string for 'day of the week' does not
                    recognize justification
           Product: glibc
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: time
          Assignee: unassigned at sourceware dot org
          Reporter: erbenton at comcast dot net
  Target Milestone: ---

Created attachment 12690
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12690&action=edit
C program demonstrating the issue

glibc 2.26 and 2.31 (x86_64)
strftime's format string %A does not recognize %-10A while %10A and %-A work as
expected
see attached sample program that demonstrates that there is no difference in
output between %10A and %-10A
Leaving out the width specifier (%A and %-A) produces the correct:
  Saturday Jul 11, 8:59:44 pm
Saturday Jul 11, 8:59:44 pm
but including the width specifier produces the same string for %10A and %-10A
  Saturday Jul 11, 8:57:42 pm
  Saturday Jul 11, 8:57:42 pm

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug time/26226] strftime format string for 'day of the week' does not recognize justification

Sourceware - glibc-bugs mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=26226

Andreas Schwab <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from Andreas Schwab <[hidden email]> ---
The '-' flag is only valid for numeric formats.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug time/26226] strftime format string for 'day of the week' does not recognize justification

Sourceware - glibc-bugs mailing list
In reply to this post by Sourceware - glibc-bugs mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=26226

Cat22 <erbenton at comcast dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|INVALID                     |FIXED

--- Comment #2 from Cat22 <erbenton at comcast dot net> ---
That makes it different than the behavior of sprintf or printf.
Shouldn't it be desirable to try to conform to the same rules when possible?
Note that the "-" *is* recognized for %A even though you are correct the man
page claims it is only for numeric formats. It just does not recognize it when
there is a width value involved. Seems like this is also contra the man page -
either way this should be reconsidered and implemented as its worth doing imho.
Here's my reasoning:
1: It makes column alignment much easier
2: closer conformance with sprint/snprintf/printf format specifiers
3: The fix should be fairly easy (low resource requirements) considering the
basic code is available in the code for printf/sprintf and already implemented
for strftime with numerics

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug time/26226] strftime format string for 'day of the week' does not recognize justification

Sourceware - glibc-bugs mailing list
In reply to this post by Sourceware - glibc-bugs mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=26226

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-
                 CC|                            |fweimer at redhat dot com
         Resolution|FIXED                       |INVALID

--- Comment #3 from Florian Weimer <fweimer at redhat dot com> ---
'-' is already used by another GNU extension, to suppress padding.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug time/26226] strftime format string for 'day of the week' does not recognize justification

Sourceware - glibc-bugs mailing list
In reply to this post by Sourceware - glibc-bugs mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=26226

--- Comment #4 from Andreas Schwab <[hidden email]> ---
strftime and printf formats are unrelated.

--
You are receiving this mail because:
You are on the CC list for the bug.