diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-07-11 10:44:14 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-07-11 10:44:14 -0700 |
commit | 0c72d6da31dd6ffce56989e4bcbd1b8650b1ef25 (patch) | |
tree | 28ec9bc02f2918c704abdf1b8f6efb5cf9fd1b05 /date.c | |
parent | Merge branch 'js/mingw-parameter-less-c-functions' into maint (diff) | |
parent | local_tzoffset: detect errors from tm_to_time_t (diff) | |
download | tgif-0c72d6da31dd6ffce56989e4bcbd1b8650b1ef25.tar.xz |
Merge branch 'jk/tzoffset-fix' into maint
The internal code used to show local timezone offset is not
prepared to handle timestamps beyond year 2100, and gave a
bogus offset value to the caller. Use a more benign looking
+0000 instead and let "git log" going in such a case, instead
of aborting.
* jk/tzoffset-fix:
local_tzoffset: detect errors from tm_to_time_t
t0006: test various date formats
t0006: rename test-date's "show" to "relative"
Diffstat (limited to 'date.c')
-rw-r--r-- | date.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -74,6 +74,8 @@ static int local_tzoffset(unsigned long time) localtime_r(&t, &tm); t_local = tm_to_time_t(&tm); + if (t_local == -1) + return 0; /* error; just use +0000 */ if (t_local < t) { eastwest = -1; offset = t - t_local; |