This is the mail archive of the glibc-cvs@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]

GNU C Library master sources branch master updated. glibc-2.18-492-g19e3372


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  19e3372ba4538f85b6c73361feaf408ae0e65ebe (commit)
      from  ecaf142d3d70630a0d7f028d334b5339ff2b996d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=19e3372ba4538f85b6c73361feaf408ae0e65ebe

commit 19e3372ba4538f85b6c73361feaf408ae0e65ebe
Author: OndÅ?ej Bílka <neleai@seznam.cz>
Date:   Wed Dec 4 13:53:13 2013 +0100

    Allow strptime read outputs from strftime. Fixes bug 4772.

diff --git a/ChangeLog b/ChangeLog
index c191b98..2f04edd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
 	* scripts/bench.pl: Skip over blank lines.
diff --git a/time/strptime_l.c b/time/strptime_l.c
index c2c2ee8..b9a8e14 100644
--- a/time/strptime_l.c
+++ b/time/strptime_l.c
@@ -320,17 +320,14 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
 	}
 
       ++fmt;
-      if (statep != NULL)
-	{
-	  /* In recursive calls silently discard strftime modifiers.  */
-	  while (*fmt == '-' || *fmt == '_' || *fmt == '0'
-		 || *fmt == '^' || *fmt == '#')
-	    ++fmt;
-
-	  /* And field width.  */
-	  while (*fmt >= '0' && *fmt <= '9')
-	    ++fmt;
-	}
+      /* We discard strftime modifiers.  */
+      while (*fmt == '-' || *fmt == '_' || *fmt == '0'
+	     || *fmt == '^' || *fmt == '#')
+	++fmt;
+
+      /* And field width.  */
+      while (*fmt >= '0' && *fmt <= '9')
+	++fmt;
 
 #ifndef _NL_CURRENT
       /* We need this for handling the `E' modifier.  */
diff --git a/time/tst-strptime.c b/time/tst-strptime.c
index 193f7db..5c5fa7b 100644
--- a/time/tst-strptime.c
+++ b/time/tst-strptime.c
@@ -41,6 +41,8 @@ static const struct
   { "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 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", "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",

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog           |    8 ++++++++
 time/strptime_l.c   |   19 ++++++++-----------
 time/tst-strptime.c |    2 ++
 3 files changed, 18 insertions(+), 11 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


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