Allow strptime read outputs from strftime. Fixes bug 4772.
This commit is contained in:
parent
ecaf142d3d
commit
19e3372ba4
@ -1,3 +1,11 @@
|
|||||||
|
2013-12-04 Ondřej Bílka <neleai@seznam.cz>
|
||||||
|
|
||||||
|
[BZ #4772]
|
||||||
|
* time/strptime_l.c (__strptime_internal): Allow modifiers
|
||||||
|
in strptime.
|
||||||
|
* time/tst-strptime.c (day_tests): Add testcase.
|
||||||
|
|
||||||
|
|
||||||
2013-12-04 Siddhesh Poyarekar <siddhesh@redhat.com>
|
2013-12-04 Siddhesh Poyarekar <siddhesh@redhat.com>
|
||||||
|
|
||||||
* scripts/bench.pl: Skip over blank lines.
|
* scripts/bench.pl: Skip over blank lines.
|
||||||
|
@ -320,9 +320,7 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
|
|||||||
}
|
}
|
||||||
|
|
||||||
++fmt;
|
++fmt;
|
||||||
if (statep != NULL)
|
/* We discard strftime modifiers. */
|
||||||
{
|
|
||||||
/* In recursive calls silently discard strftime modifiers. */
|
|
||||||
while (*fmt == '-' || *fmt == '_' || *fmt == '0'
|
while (*fmt == '-' || *fmt == '_' || *fmt == '0'
|
||||||
|| *fmt == '^' || *fmt == '#')
|
|| *fmt == '^' || *fmt == '#')
|
||||||
++fmt;
|
++fmt;
|
||||||
@ -330,7 +328,6 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
|
|||||||
/* And field width. */
|
/* And field width. */
|
||||||
while (*fmt >= '0' && *fmt <= '9')
|
while (*fmt >= '0' && *fmt <= '9')
|
||||||
++fmt;
|
++fmt;
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef _NL_CURRENT
|
#ifndef _NL_CURRENT
|
||||||
/* We need this for handling the `E' modifier. */
|
/* We need this for handling the `E' modifier. */
|
||||||
|
@ -41,6 +41,8 @@ static const struct
|
|||||||
{ "C", "19990502123412", "%Y%m%d%H%M%S", 0, 121, 4, 2 },
|
{ "C", "19990502123412", "%Y%m%d%H%M%S", 0, 121, 4, 2 },
|
||||||
{ "C", "2001 20 Mon", "%Y %U %a", 1, 140, 4, 21 },
|
{ "C", "2001 20 Mon", "%Y %U %a", 1, 140, 4, 21 },
|
||||||
{ "C", "2001 21 Mon", "%Y %W %a", 1, 140, 4, 21 },
|
{ "C", "2001 21 Mon", "%Y %W %a", 1, 140, 4, 21 },
|
||||||
|
{ "C", "2001 21 Mon", "%2000Y %W %a", 1, 140, 4, 21 },
|
||||||
|
{ "C", "2001 21 Mon", "%^Y %W %a", 1, 140, 4, 21 },
|
||||||
{ "C", "2001 EST 21 Mon", "%Y %Z %W %a", 1, 140, 4, 21 },
|
{ "C", "2001 EST 21 Mon", "%Y %Z %W %a", 1, 140, 4, 21 },
|
||||||
{ "C", "2012 00 Sun", "%Y %W %a", 0, 0, 0, 1 },
|
{ "C", "2012 00 Sun", "%Y %W %a", 0, 0, 0, 1 },
|
||||||
{ "ja_JP.EUC-JP", "2000-01-01 08:12:21 AM", "%Y-%m-%d %I:%M:%S %p",
|
{ "ja_JP.EUC-JP", "2000-01-01 08:12:21 AM", "%Y-%m-%d %I:%M:%S %p",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user