Revision bab748371a104c58058c0eff9f4073b710ce0355 authored by Jeff King on 20 June 2016, 21:14:14 UTC, committed by Junio C Hamano on 20 June 2016, 22:08:07 UTC
When we want to know the local timezone offset at a given
timestamp, we compute it by asking for localtime() at the
given time, and comparing the offset to GMT at that time.
However, there's some juggling between time_t and "struct
tm" which happens, which involves calling our own
tm_to_time_t().

If that function returns an error (e.g., because it only
handles dates up to the year 2099), it returns "-1", which
we treat as a time_t, and is clearly bogus, leading to
bizarre timestamps (that seem to always adjust the time back
to (time_t)(uint32_t)-1, in the year 2106).

It's not a good idea for local_tzoffset() to simply die
here; it would make it hard to run "git log" on a repository
with funny timestamps. Instead, let's just treat such cases
as "zero offset".

Reported-by: Norbert Kiesel <nkiesel@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 36d6792
Raw File
git.rc
1 VERSIONINFO
FILEVERSION     MAJOR,MINOR,0,0
PRODUCTVERSION  MAJOR,MINOR,0,0
BEGIN
  BLOCK "StringFileInfo"
  BEGIN
    BLOCK "040904b0"   /* LANG_ENGLISH/SUBLANG_ENGLISH_US, Unicode CP */
    BEGIN
      VALUE "CompanyName", "The Git Development Community\0"
      VALUE "FileDescription", "Git for Windows\0"
      VALUE "InternalName", "git\0"
      VALUE "OriginalFilename", "git.exe\0"
      VALUE "ProductName", "Git\0"
      VALUE "ProductVersion", GIT_VERSION "\0"
    END
  END

  BLOCK "VarFileInfo"
  BEGIN
    VALUE "Translation", 0x409, 1200
  END
END
back to top