From 887617d0dd0f98594f14e2bee7a99c4531ffa6cd Mon Sep 17 00:00:00 2001 From: Sup Yut Sum Date: Thu, 19 Mar 2020 21:20:13 +0800 Subject: [PATCH] Can display author/commit date after year 2038 Signed-off-by: Sup Yut Sum --- ext/gitdll/gitdll.c | 2 +- ext/gitdll/gitdll.h | 4 ++-- src/Git/GitRevRefBrowser.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/gitdll/gitdll.c b/ext/gitdll/gitdll.c index fbf14244c..8f57ed592 100644 --- a/ext/gitdll/gitdll.c +++ b/ext/gitdll/gitdll.c @@ -131,7 +131,7 @@ static int git_parse_commit_author(struct GIT_COMMIT_AUTHOR* author, const char* pbuff = end + 2; - author->Date = atol(pbuff); + author->Date = atoll(pbuff); end = strchr(pbuff, ' '); if( end == 0 ) return -1; diff --git a/ext/gitdll/gitdll.h b/ext/gitdll/gitdll.h index 868798377..fdefbf350 100644 --- a/ext/gitdll/gitdll.h +++ b/ext/gitdll/gitdll.h @@ -1,6 +1,6 @@ // TortoiseGit - a Windows shell extension for easy version control -// Copyright (C) 2008-2019 - TortoiseGit +// Copyright (C) 2008-2020 - TortoiseGit // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -60,7 +60,7 @@ struct GIT_COMMIT_AUTHOR int NameSize; const char* Email; int EmailSize; - int Date; + long long Date; int TimeZone; }; diff --git a/src/Git/GitRevRefBrowser.cpp b/src/Git/GitRevRefBrowser.cpp index d82d86073..8e4d31f26 100644 --- a/src/Git/GitRevRefBrowser.cpp +++ b/src/Git/GitRevRefBrowser.cpp @@ -78,7 +78,7 @@ int GitRevRefBrowser::GetGitRevRefMap(MAP_REF_GITREVREFBROWSER& map, int mergefi ref.m_AuthorName = singleRef.Tokenize(L"\04", valuePos).Trim(); if (valuePos < 0) continue; CString email = singleRef.Tokenize(L"\04", valuePos).Trim().Trim(L"<>"); if (valuePos < 0) continue; CString date = singleRef.Tokenize(L"\04", valuePos).Trim(); - ref.m_AuthorDate = StrToInt(date); + ref.m_AuthorDate = _wtoll(date); if (ref.m_AuthorName.IsEmpty()) { ref.m_AuthorName = singleRef.Tokenize(L"\04", valuePos).Trim(); if (valuePos < 0) continue; @@ -86,7 +86,7 @@ int GitRevRefBrowser::GetGitRevRefMap(MAP_REF_GITREVREFBROWSER& map, int mergefi email.Truncate(max(0, email.Find(L'>'))); ref.m_AuthorName.Truncate(max(0, ref.m_AuthorName.Find(L" <"))); date = singleRef.Tokenize(L"\04", valuePos).Trim(); - ref.m_AuthorDate = StrToInt(date); + ref.m_AuthorDate = _wtoll(date); } if (mailmap) ref.m_AuthorName = mailmap.TranslateAuthor(ref.m_AuthorName, email); -- 2.11.4.GIT