diff options
| author | Dima Dorfman <dd@FreeBSD.org> | 2001-07-13 13:59:24 +0000 |
|---|---|---|
| committer | Dima Dorfman <dd@FreeBSD.org> | 2001-07-13 13:59:24 +0000 |
| commit | 427fc5ed6fc8d69e6c65c445a9ff61017ce2d2ec (patch) | |
| tree | 35dbc220958bf6704b9a286a493c56b90660e7b2 | |
| parent | 2e1b1231fc5c5b4b6068fa3cd22c1609c988f11c (diff) | |
Notes
| -rw-r--r-- | lib/libc/stdtime/strptime.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/libc/stdtime/strptime.c b/lib/libc/stdtime/strptime.c index 09f8e18e579d..bcda42b38605 100644 --- a/lib/libc/stdtime/strptime.c +++ b/lib/libc/stdtime/strptime.c @@ -67,6 +67,8 @@ static char sccsid[] = "@(#)strptime.c 0.1 (Powerdog) 94/03/27"; #include "namespace.h" #include <time.h> #include <ctype.h> +#include <limits.h> +#include <stdlib.h> #include <string.h> #include <pthread.h> #include "un-namespace.h" @@ -445,6 +447,20 @@ label: ptr++; break; + case 's': + { + char *cp; + time_t t; + + t = strtol(buf, &cp, 10); + if (t == LONG_MAX) + return 0; + buf = cp; + gmtime_r(&t, tm); + got_GMT = 1; + } + break; + case 'Y': case 'y': if (*buf == 0 || isspace((unsigned char)*buf)) |
