Skip to content

Commit

Permalink
[BZ #6657]
Browse files Browse the repository at this point in the history
2008-06-27  Ulrich Drepper  <drepper@redhat.com>
	[BZ #6657]
	* time/strptime_l.c: Don't clear s.era_cnt after successful match
	of %EY.
	Patch by Petr Baudis.
  • Loading branch information
Ulrich Drepper committed Jun 27, 2008
1 parent 34ca2ff commit 80922a9
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2008-06-27 Ulrich Drepper <drepper@redhat.com>

[BZ #6657]
* time/strptime_l.c: Don't clear s.era_cnt after successful match
of %EY.
Patch by Petr Baudis.

2008-06-26 Ulrich Drepper <drepper@redhat.com>

* resolv/res_debig.c (__p_type_syms): Add ns_t_dname entry.
Expand Down
4 changes: 4 additions & 0 deletions localedata/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2008-06-27 Ulrich Drepper <drepper@redhat.com>

* tst-strptime.c (do_test): Add test of %EY.

2008-06-25 Ulrich Drepper <drepper@redhat.com>

* tst-strptime.c (do_test): Add test for parsing era year
Expand Down
10 changes: 10 additions & 0 deletions localedata/tst-strptime.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ r = %p, r-s2 = %tu, tm.tm_mday = %d, tm.tm_mon = %d, tm.tm_year = %d\n",
result |= (r == NULL || r - s2 != 14 || tm.tm_mday != 25 || tm.tm_mon != 5
|| tm.tm_year != 108);

static const char s3[] = "\
\x32\x35\x20\x30\x36\x20\xe5\xb9\xb3\xe6\x88\x90\x32\x30\xe5\xb9\xb4\0";
memset (&tm, '\0', sizeof (tm));
r = strptime (s3, "%d %m %EY", &tm);
printf ("\
r = %p, r-s3 = %tu, tm.tm_mday = %d, tm.tm_mon = %d, tm.tm_year = %d\n",
r, r - s3, tm.tm_mday, tm.tm_mon, tm.tm_year);
result |= (r == NULL || r - s3 != 17 || tm.tm_mday != 25 || tm.tm_mon != 5
|| tm.tm_year != 108);

return result;
}

Expand Down
3 changes: 1 addition & 2 deletions time/strptime_l.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2004, 2005, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -951,7 +951,6 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
else
{
s.decided = loc;
s.era_cnt = -1;
break;
}

Expand Down

0 comments on commit 80922a9

Please sign in to comment.