This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/4772] New: strptime() doesn't support strftime()'s flags


Tomasz KÄ?pczyÅ?ski has found a bug in strptime(): its format specification
doesn't support strftime()'s flags.


Steps to reproduce:

$ cat foo.c
#define _XOPEN_SOURCE

#include <stdio.h>
#include <time.h>

int
main(void)
{
    struct tm tm;

    printf("%s\n", strptime("1", "%-d", &tm) ? "Success!" : "Woe is me!");

    return 0;
}
$ gcc foo.c && ./a.out
Woe is me!
$


As a result, gnucash misparses dates in, at least, Polish and Czech locale (see
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=243513).

The attached patch against cvs head causes strptime() to correctly parse and
interpret (i.e. ignore) flags and field width.

-- 
           Summary: strptime() doesn't support strftime()'s flags
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: inkerman42 at gmail dot com
                CC: glibc-bugs at sources dot redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=4772

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]