X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fposixtm.c;h=85936f3c6b1fe0238b53e45381f57ae146ed44db;hb=47b3dd4ed61927c7dfc9ba870d9c0fa763ac57d8;hp=22f636ebb56c3ac62d4b5ee3b27e6ed97aebf33f;hpb=a62be9f4039b4499cfbb76e394cad2259d03fa84;p=gnulib.git diff --git a/lib/posixtm.c b/lib/posixtm.c index 22f636ebb..85936f3c6 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. */ @@ -38,7 +38,10 @@ #endif #include "posixtm.h" -#include "unlocked-io.h" + +#if USE_UNLOCKED_IO +# include "unlocked-io.h" +#endif /* ISDIGIT differs from isdigit, as follows: - Its arg may be any int or unsigned int; it need not be an unsigned char. @@ -190,7 +193,15 @@ posix_time_parse (struct tm *tm, const char *s, unsigned int syntax_bits) bool posixtime (time_t *p, const char *s, unsigned int syntax_bits) { - struct tm tm0; + struct tm tm0 +#ifdef lint + /* Placate gcc-4's -Wuninitialized. + posix_time_parse fails to set all of tm0 only when it returns + nonzero (due to year() returning nonzero), and in that case, + this code doesn't use the tm0 at all. */ + = { 0, } +#endif + ; struct tm tm1; struct tm const *tm; time_t t;