X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=lib%2Fgetdate.y;h=289f8121e6735b61d84049d23f9f371d5f463f47;hb=4bfdfaa270155e6e9a32f2c8c459a510c77dd854;hp=3210e53676f768d391a60742351d518818489cf1;hpb=bff9056e888c7daa3a5950706fefae3b4671de02;p=chaz%2Ftar diff --git a/lib/getdate.y b/lib/getdate.y index 3210e53..289f812 100644 --- a/lib/getdate.y +++ b/lib/getdate.y @@ -63,10 +63,9 @@ - Its arg may be any int or unsigned int; it need not be an unsigned char. - It's guaranteed to evaluate its argument exactly once. - It's typically faster. - Posix 1003.2-1992 section 2.5.2.1 page 50 lines 1556-1558 says that - only '0' through '9' are digits. Prefer ISDIGIT to ISDIGIT_LOCALE unless - it's important to use the locale's definition of `digit' even when the - host does not conform to Posix. */ + POSIX says that only '0' through '9' are digits. Prefer ISDIGIT to + ISDIGIT_LOCALE unless it's important to use the locale's definition + of `digit' even when the host does not conform to POSIX. */ #define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) #if STDC_HEADERS || HAVE_STRING_H @@ -378,19 +377,19 @@ relunit: | tSNUMBER tDAY_UNIT { PC.rel_day += $1.value * $2; } | tDAY_UNIT - { PC.rel_day += $1 } + { PC.rel_day += $1; } | tUNUMBER tHOUR_UNIT { PC.rel_hour += $1.value * $2; } | tSNUMBER tHOUR_UNIT { PC.rel_hour += $1.value * $2; } | tHOUR_UNIT - { PC.rel_hour += $1 } + { PC.rel_hour += $1; } | tUNUMBER tMINUTE_UNIT { PC.rel_minutes += $1.value * $2; } | tSNUMBER tMINUTE_UNIT { PC.rel_minutes += $1.value * $2; } | tMINUTE_UNIT - { PC.rel_minutes += $1 } + { PC.rel_minutes += $1; } | tUNUMBER tSEC_UNIT { PC.rel_seconds += $1.value * $2; } | tSNUMBER tSEC_UNIT @@ -448,6 +447,7 @@ o_merid: may define-away `const'. We want the prototype for get_date to have the same signature as the function definition. */ #include "getdate.h" +#include "unlocked-io.h" #ifndef gmtime struct tm *gmtime (); @@ -990,7 +990,8 @@ get_date (const char *p, const time_t *now) /* Let mktime deduce tm_isdst if we have an absolute time stamp, or if the relative time stamp mentions days, months, or years. */ - if (pc.dates_seen | pc.days_seen | pc.times_seen | pc.rel_day | pc.rel_month | pc.rel_year) + if (pc.dates_seen | pc.days_seen | pc.times_seen | pc.rel_day + | pc.rel_month | pc.rel_year) tm.tm_isdst = -1; /* But if the input explicitly specifies local time with or without @@ -1037,6 +1038,7 @@ get_date (const char *p, const time_t *now) { tm.tm_mday += ((pc.day_number - tm.tm_wday + 7) % 7 + 7 * (pc.day_ordinal - (0 < pc.day_ordinal))); + tm.tm_isdst = -1; Start = mktime (&tm); if (Start == (time_t) -1) return Start;