]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
[BZ #4772]
authorUlrich Drepper <drepper@redhat.com>
Sat, 28 Jul 2007 19:10:22 +0000 (19:10 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 28 Jul 2007 19:10:22 +0000 (19:10 +0000)
* time/strptime_l.c (__strptime_internal): Silently ignore
strftime modifiers and field width in recursive calls.

ChangeLog
time/strptime_l.c

index b2d9424fc4c59a4628c3637e738e00ec8fd23ab1..c591d319576e4471eaddfd5927ad12f810736306 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2007-07-20  Jakub Jelinek  <jakub@redhat.com>
 
+       [BZ #4772]
+       * time/strptime_l.c (__strptime_internal): Silently ignore
+       strftime modifiers and field width in recursive calls.
+
        * include/time.h (enum ptime_locale_status): Remove.
        (__strptime_internal): Remove decided and era_cnt arguments,
        add statep argument.
index 0305fd56cb55f173699945528a944e0457b7bd56..59a557c22b216b9819efde97633097f3fbbb2495 100644 (file)
@@ -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: