summaryrefslogtreecommitdiff
path: root/date.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-30 14:31:28 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-30 14:31:28 -0700
commita90588821ac9d3dafc4afa7ebe4e0bc48e9f77c9 (patch)
treea8b52dc53bc098567bb9473065df88ba1c11e744 /date.c
parenteaa85129230e568757b39b965beee513c8106b37 (diff)
downloadgit-a90588821ac9d3dafc4afa7ebe4e0bc48e9f77c9.tar.gz
date.c: fix parsing of dates in mm/dd/yy format
We looked at the year one character too early, and we didn't accept a two-character year date after 2000.
Diffstat (limited to 'date.c')
-rw-r--r--date.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/date.c b/date.c
index ffa4246aa0..15f28198e1 100644
--- a/date.c
+++ b/date.c
@@ -203,9 +203,11 @@ static int match_digit(char *date, struct tm *tm, int *offset)
tm->tm_mon = num - 1;
tm->tm_mday = num2;
if (*end == c && isdigit(end[1])) {
- num3 = strtoul(end, &end, 10);
+ num3 = strtoul(end+1, &end, 10);
if (num3 > 1900)
num3 -= 1900;
+ else if (num3 < 38)
+ num3 += 100;
tm->tm_year = num3;
}
break;