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

[PATCH][BZ #4772] Allow strptime read outputs from strftime.


Another simple bug that was left for five years. A problem is that a
strptime does not parse modifiers. It contain a simple patch to fix that
issue.

In meantime a identical functionality was added for recursive calls so
this patch just enables this uncoditionally.

OK to commit?


	* time/strptime_l.c: Allow modifiers in strptime.

diff --git a/time/strptime_l.c b/time/strptime_l.c
index 00fc1ef..395532d 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.  */


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