X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fposixtm.c;h=5273a71f44711f570102770dab134b96953097fb;hb=45a14d0fe450d6b70c404cc9ae6aca4f31054896;hp=1400e5a51d7e35de5b35ba92666978426217b65b;hpb=917752adb19961999cd68c6c961efffe33c85141;p=gnulib.git diff --git a/lib/posixtm.c b/lib/posixtm.c index 1400e5a51..5273a71f4 100644 --- a/lib/posixtm.c +++ b/lib/posixtm.c @@ -1,6 +1,6 @@ /* Parse dates for touch and date. - Copyright (C) 1989, 1990, 1991, 1998, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1989, 1990, 1991, 1998, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation Inc. This program is free software; you can redistribute it and/or modify @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Yacc-based version written by Jim Kingdon and David MacKenzie. Rewritten by Jim Meyering. */ @@ -198,6 +198,14 @@ posixtime (time_t *p, const char *s, unsigned int syntax_bits) struct tm const *tm; time_t t; +#ifdef lint + /* Placate gcc-4's -Wuninitialized. + posix_time_parse fails to set tm0.tm_year only when it returns + nonzero (due to year() returning nonzero), and in that case, + this code doesn't use the tm0 at all. */ + tm0.tm_year = 0; +#endif + if (posix_time_parse (&tm0, s, syntax_bits)) return false;