about summary refs log tree commit diff
path: root/time/strptime_l.c
diff options
context:
space:
mode:
Diffstat (limited to 'time/strptime_l.c')
-rw-r--r--time/strptime_l.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/time/strptime_l.c b/time/strptime_l.c
index 0305fd56cb..59a557c22b 100644
--- a/time/strptime_l.c
+++ b/time/strptime_l.c
@@ -330,6 +330,18 @@ __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;
+	}
+
 #ifndef _NL_CURRENT
       /* We need this for handling the `E' modifier.  */
     start_over: