diff options
| author | Xin LI <delphij@FreeBSD.org> | 2009-07-26 09:00:37 +0000 |
|---|---|---|
| committer | Xin LI <delphij@FreeBSD.org> | 2009-07-26 09:00:37 +0000 |
| commit | 4696b40dc34a2bcc097d23008a621b98ca655177 (patch) | |
| tree | 164680d0f59c5ad171df4ba1bc0b49ea47ba655b /lib/libc | |
| parent | 966f0ee0806a00a8608821acbb60fb20971083ee (diff) | |
Notes
Diffstat (limited to 'lib/libc')
| -rw-r--r-- | lib/libc/stdtime/strptime.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/libc/stdtime/strptime.c b/lib/libc/stdtime/strptime.c index ddf6b57e38fc..c7de35c0d686 100644 --- a/lib/libc/stdtime/strptime.c +++ b/lib/libc/stdtime/strptime.c @@ -514,6 +514,34 @@ label: } } break; + + case 'z': + { + int sign = 1; + + if (*buf != '+') { + if (*buf == '-') + sign = -1; + else + return 0; + } + + buf++; + i = 0; + for (len = 4; len > 0; len--) { + if (isdigit((int)*buf)) { + i *= 10; + i += *buf - '0'; + buf++; + } else + return 0; + } + + tm->tm_hour -= sign * (i / 100); + tm->tm_min -= sign * (i % 100); + *GMTp = 1; + } + break; } } return (char *)buf; |
