X-Git-Url: https://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fgetdate.y;h=35d064f48a9e917a4bb09ff494c5cb603be98268;hb=33ca528b935235488d47aa6e7ed3fdbc46eb16c2;hp=09340da8b8580e8d378a29ec7fcacb3dd3a66421;hpb=23dd080773057f6fbbcb37f1d616ec0c1fb762af;p=gnulib.git diff --git a/lib/getdate.y b/lib/getdate.y index 09340da8b..35d064f48 100644 --- a/lib/getdate.y +++ b/lib/getdate.y @@ -35,20 +35,6 @@ solely to allow compilation by non GNU-C compilers of the C parser produced from this file by old versions of bison. Newer versions of bison include a block similar to this one in bison.simple. */ - -#ifdef __GNUC__ -#define alloca __builtin_alloca -#else -#ifdef HAVE_ALLOCA_H -#include -#else -#ifdef _AIX - #pragma alloca -#else -void *alloca (); -#endif -#endif -#endif #ifdef __GNUC__ #undef alloca @@ -382,25 +368,24 @@ number : tUNUMBER { yyYear = $1; else { if($1>10000) { - time_t date_part; - - date_part= $1/10000; yyHaveDate++; - yyDay= (date_part)%100; - yyMonth= (date_part/100)%100; - yyYear = date_part/10000; - } - yyHaveTime++; - if ($1 < 100) { - yyHour = $1; - yyMinutes = 0; + yyDay= ($1)%100; + yyMonth= ($1/100)%100; + yyYear = $1/10000; } else { - yyHour = $1 / 100; - yyMinutes = $1 % 100; - } - yySeconds = 0; - yyMeridian = MER24; + yyHaveTime++; + if ($1 < 100) { + yyHour = $1; + yyMinutes = 0; + } + else { + yyHour = $1 / 100; + yyMinutes = $1 % 100; + } + yySeconds = 0; + yyMeridian = MER24; + } } } ;