author | Linus Torvalds <torvalds@osdl.org> | |
Thu, 5 Jan 2006 03:33:55 +0000 (19:33 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 6 Jan 2006 01:22:43 +0000 (17:22 -0800) | ||
commit | b73cebf437252660cea670c27dcdedc422e1bff9 | |
tree | c9a822d4bdd0feb3f6c307689fe16ac56c32d660 | tree | snapshot |
parent | 0a15217184f20649c0ab19b24363e35112a91beb | commit | diff |
Fix nasty approxidate bug
Stupid me.
If approxidate ends up with a month that is ahead of the current month, it
decrements the year to last year.
Which is correct, and means that "last december" does the right thing.
HOWEVER. It should only do so if the year is the same as the current year.
Without this fix, "5 days ago" ends up being in 2004, because it first
decrements five days, getting us to December 2005 (correct), but then it
also ends up decrementing the year once more to turn that December into
"last year" (incorrect, since it already _was_ last year).
Duh. Pass me a donut.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Stupid me.
If approxidate ends up with a month that is ahead of the current month, it
decrements the year to last year.
Which is correct, and means that "last december" does the right thing.
HOWEVER. It should only do so if the year is the same as the current year.
Without this fix, "5 days ago" ends up being in 2004, because it first
decrements five days, getting us to December 2005 (correct), but then it
also ends up decrementing the year once more to turn that December into
"last year" (incorrect, since it already _was_ last year).
Duh. Pass me a donut.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
date.c | diff | blob | history |