X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=date.c;h=416ea579a3eb1dbc910817413f995556ad115b29;hb=d5a6aafc90a14382120727e4e81ee1a380e8b194;hp=3e11500eda5e75a7ec354441fe4a24fd5ebf8bbc;hpb=3eeb419968c1f8f0a762a7127db770e9d9c8037d;p=git.git diff --git a/date.c b/date.c index 3e11500e..416ea579 100644 --- a/date.c +++ b/date.c @@ -326,7 +326,7 @@ static int match_digit(const char *date, struct tm *tm, int *offset, int *tm_gmt /* * NOTE! We will give precedence to day-of-month over month or - * year numebers in the 1-12 range. So 05 is always "mday 5", + * year numbers in the 1-12 range. So 05 is always "mday 5", * unless we already have a mday.. * * IOW, 01 Apr 05 parses as "April 1st, 2005". @@ -640,7 +640,7 @@ unsigned long approxidate(const char *date) } if (number > 0 && number < 32) tm.tm_mday = number; - if (tm.tm_mon > now.tm_mon) + if (tm.tm_mon > now.tm_mon && tm.tm_year == now.tm_year) tm.tm_year--; return mktime(&tm); }