diff options
author | Jakub Jelinek <jakub@redhat.com> | 2009-03-09 14:35:26 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2009-03-09 14:35:26 +0000 |
commit | 5c1d419918b3637170da9a5592049048aaf0ee49 (patch) | |
tree | 8ad672f8707275fdbeaf5b8a45eeb2bc8144623a /time | |
parent | 48da74123eca38beeaec03d3d46ba09f069ef7dc (diff) |
Updated to fedora-glibc-20090309T1421cvs/fedora-glibc-2_9_90-9
Diffstat (limited to 'time')
-rw-r--r-- | time/sys/time.h | 4 | ||||
-rw-r--r-- | time/time.h | 7 | ||||
-rw-r--r-- | time/tzset.c | 48 |
3 files changed, 45 insertions, 14 deletions
diff --git a/time/sys/time.h b/time/sys/time.h index 177696b08a..3aecf60b61 100644 --- a/time/sys/time.h +++ b/time/sys/time.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-1994,1996-2002,2003,2005,2006 +/* Copyright (C) 1991-1994,1996-2003,2005,2006,2009 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -149,7 +149,7 @@ extern int lutimes (__const char *__file, __const struct timeval __tvp[2]) extern int futimes (int __fd, __const struct timeval __tvp[2]) __THROW; #endif -#ifdef __USE_ATFILE +#ifdef __USE_GNU /* Change the access time of FILE relative to FD to TVP[0] and the modification time of FILE to TVP[1]. If TVP is a null pointer, use the current time instead. Returns 0 on success, -1 on errors. */ diff --git a/time/time.h b/time/time.h index 6c8f79d422..eb7549ddf4 100644 --- a/time/time.h +++ b/time/time.h @@ -1,5 +1,4 @@ -/* Copyright (C) 1991-1999,2000,2001,2002,2003,2006 - Free Software Foundation, Inc. +/* Copyright (C) 1991-2003,2006,2009 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -210,7 +209,7 @@ extern char *strptime (__const char *__restrict __s, __THROW; # endif -# ifdef __USE_GNU +# ifdef __USE_XOPEN2K8 /* Similar to the two functions above but take the information from the provided locale and not the global locale. */ # include <xlocale.h> @@ -219,7 +218,9 @@ extern size_t strftime_l (char *__restrict __s, size_t __maxsize, __const char *__restrict __format, __const struct tm *__restrict __tp, __locale_t __loc) __THROW; +# endif +# ifdef __USE_GNU extern char *strptime_l (__const char *__restrict __s, __const char *__restrict __fmt, struct tm *__tp, __locale_t __loc) __THROW; diff --git a/time/tzset.c b/time/tzset.c index 45d70518a8..5cde0bfbd5 100644 --- a/time/tzset.c +++ b/time/tzset.c @@ -174,14 +174,26 @@ __tzset_parse_tz (tz) /* Get the standard timezone name. */ tzbuf = strdupa (tz); - if (sscanf (tz, "%[^0-9,+-]", tzbuf) != 1 || - (l = strlen (tzbuf)) < 3) + if (sscanf (tz, "%[A-Za-z]", tzbuf) != 1) + { + /* Check for the quoted version. */ + char *wp = tzbuf; + if (*tz++ != '<') + goto out; + + while (isalnum (*tz) || *tz == '+' || *tz == '-') + *wp++ = *tz++; + if (*tz++ != '>' || wp - tzbuf < 3) + goto out; + *wp = '\0'; + } + else if ((l = strlen (tzbuf)) < 3) goto out; + else + tz += l; tz_rules[0].name = __tzstring (tzbuf); - tz += l; - /* Figure out the standard offset from UTC. */ if (*tz == '\0' || (*tz != '+' && *tz != '-' && !isdigit (*tz))) goto out; @@ -217,13 +229,31 @@ __tzset_parse_tz (tz) if (*tz != '\0') { char *n = tzbuf + strlen (tzbuf) + 1; - if (sscanf (tz, "%[^0-9,+-]", n) != 1 || - (l = strlen (n)) < 3) - goto done_names; /* Punt on name, set up the offsets. */ - tz_rules[1].name = __tzstring (n); + if (sscanf (tz, "%[A-Za-z]", tzbuf) != 1) + { + /* Check for the quoted version. */ + char *wp = tzbuf; + const char *rp = tz; + if (*rp++ != '<') + /* Punt on name, set up the offsets. */ + goto done_names; + + while (isalnum (*rp) || *rp == '+' || *rp == '-') + *wp++ = *rp++; + if (*rp++ != '>' || wp - tzbuf < 3) + /* Punt on name, set up the offsets. */ + goto done_names; + *wp = '\0'; + tz = rp; + } + else if ((l = strlen (tzbuf)) < 3) + /* Punt on name, set up the offsets. */ + goto done_names; + else + tz += l; - tz += l; + tz_rules[1].name = __tzstring (n); /* Figure out the DST offset from GMT. */ if (*tz == '-' || *tz == '+') |