@matheusbsbs / matheus-bagliano / commits / 7122f82f56
Fork 0

date.c: improve guess between timezone offset and year.

When match_digit() guesses a four-digit string to tell if it is a year or a timezone, it did not consider that some real-world places have UTC offsets equal to +1400. $ date; TZ=UTC0 date; TZ=Pacific/Kiritimati date Wed Jun 7 23:25:42 PDT 2006 Thu Jun 8 06:25:42 UTC 2006 Thu Jun 8 20:25:42 LINT 2006 Signed-off-by: Paul Eggert <eggert@CS.UCLA.EDU> Signed-off-by: Junio C Hamano <junkio@cox.net>

Paul Eggert committed Jun 8, 2006 at 14:54 UTC 7122f82f56425d942bc5e892ed5e6b3bbd0a6724
1 file changed +1 -1
date.c
+1 -1
@@ -369,7 +369,7 @@ static int match_digit(const char *date, struct tm *tm, int *offset, int *tm_gmt
369
370 /* Four-digit year or a timezone? */
371 if (n == 4) {
372 - if (num <= 1200 && *offset == -1) {
372 + if (num <= 1400 && *offset == -1) {
373 unsigned int minutes = num % 100;
374 unsigned int hours = num / 100;
375 *offset = hours*60 + minutes;