[PATCH] parse_date(): fix parsing 03/10/2006
- From
Junio C Hamano <junkio@cox.net>
- Date
- Apr 5, 2006, 06:00 UTC
- Message-ID
- <7vodzg4l5n.fsf@assigned-by-dhcp.cox.net>
The comment associated with the date parsing code for three numbers separated with slashes or dashes implied we wanted to interpret using this order:
yyyy-mm-dd yyyy-dd-mm mm-dd-yy dd-mm-yy
However, the actual code had the last two wrong, and making it prefer dd-mm-yy format over mm-dd-yy.
Signed-off-by: Junio C Hamano <junkio@cox.net>
--- * Spotted, thanks to Len Brown and Andrew Morton.
date.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
f5cd7df6e8322a0b783668b31881ab95a5ce33bd
diff --git a/date.c b/date.c index 416ea57..18a0710 100644 --- a/date.c +++ b/date.c @@ -257,10 +257,10 @@ static int match_multi_number(unsigned l break; } /* mm/dd/yy ? */ - if (is_date(num3, num2, num, tm)) + if (is_date(num3, num, num2, tm)) break; /* dd/mm/yy ? */ - if (is_date(num3, num, num2, tm)) + if (is_date(num3, num2, num, tm)) break; return 0; }
-- 1.3.0.rc2.g110c