summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2005-11-18 19:00:29 +0000
committerJeff Johnston <jjohnstn@redhat.com>2005-11-18 19:00:29 +0000
commit6b1a6ec67b55220b26f912b8da91fb0cb8a0989e (patch)
tree909ce72c6d67b424156722b0689e013e11438ff6
parent19e7c3a068718b5a8493a5458bd440824ab77757 (diff)
downloadcygnal-6b1a6ec67b55220b26f912b8da91fb0cb8a0989e.tar.gz
cygnal-6b1a6ec67b55220b26f912b8da91fb0cb8a0989e.tar.bz2
cygnal-6b1a6ec67b55220b26f912b8da91fb0cb8a0989e.zip
2005-11-18 Jeff Johnston <jjohnstn@redhat.com>
* libc/time/strptime.c (strptime): Don't abort for %c and %Z. Treat %c as "%a %b %e %H:%M:%S %Y" and ignore %Z.
-rw-r--r--newlib/ChangeLog5
-rw-r--r--newlib/libc/time/strptime.c11
2 files changed, 13 insertions, 3 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 74e5111fb..e0c661742 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,8 @@
+2005-11-18 Jeff Johnston <jjohnstn@redhat.com>
+
+ * libc/time/strptime.c (strptime): Don't abort for %c and %Z.
+ Treat %c as "%a %b %e %H:%M:%S %Y" and ignore %Z.
+
2005-11-18 Christopher Faylor <cgf@timesys.com>
* include/sys/time.h: Move more cygwin stuff to cygwin-specific header.
diff --git a/newlib/libc/time/strptime.c b/newlib/libc/time/strptime.c
index 1d625d61e..127772460 100644
--- a/newlib/libc/time/strptime.c
+++ b/newlib/libc/time/strptime.c
@@ -249,8 +249,12 @@ _DEFUN (strptime, (buf, format, timeptr),
timeptr->tm_year = (ret * 100) - tm_year_base;
buf = s;
break;
- case 'c' :
- abort ();
+ case 'c' : /* %a %b %e %H:%M:%S %Y */
+ s = strptime (buf, "%a %b %e %H:%M:%S %Y", timeptr);
+ if (s == NULL)
+ return NULL;
+ buf = s;
+ break;
case 'D' : /* %m/%d/%y */
s = strptime (buf, "%m/%d/%y", timeptr);
if (s == NULL)
@@ -412,7 +416,8 @@ _DEFUN (strptime, (buf, format, timeptr),
buf = s;
break;
case 'Z' :
- abort ();
+ /* Unsupported. Just ignore. */
+ break;
case '\0' :
--format;
/* FALLTHROUGH */