This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/4772] New: strptime() doesn't support strftime()'s flags
- From: "inkerman42 at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 10 Jul 2007 20:46:02 -0000
- Subject: [Bug libc/4772] New: strptime() doesn't support strftime()'s flags
- Reply-to: sourceware-bugzilla at sourceware dot org
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.