Enhabnce updateTimeStamp fuction

Follow the disscussion:
https://github.com/notepad-plus-plus/notepad-plus-plus/pull/15936#discussion_r1886067242

Close #15968
This commit is contained in:
Don Ho 2024-12-19 15:55:29 +01:00
parent f535087e5d
commit cb1172e2a4

View File

@ -169,6 +169,7 @@ void Buffer::updateTimeStamp()
msg += "TRUE"; msg += "TRUE";
else else
msg += "FALSE"; msg += "FALSE";
if (bWorkerThreadTerminated) if (bWorkerThreadTerminated)
{ {
msg += ", its worker thread had to be forcefully terminated due to timeout reached!"; msg += ", its worker thread had to be forcefully terminated due to timeout reached!";
@ -184,9 +185,13 @@ void Buffer::updateTimeStamp()
writeLog(nppIssueLog.c_str(), msg.c_str()); writeLog(nppIssueLog.c_str(), msg.c_str());
} }
} }
// if getting timestamp operation fails, no timestamp to compare then no need to continue
return;
} }
LONG res = CompareFileTime(&_timeStamp, &timeStampLive); LONG res = CompareFileTime(&_timeStamp, &timeStampLive);
if (res == -1 || res == 1) if (res == -1 || res == 1)
// (res == -1) => timeStampLive is later, it means the file has been modified outside of Notepad++ - usual case // (res == -1) => timeStampLive is later, it means the file has been modified outside of Notepad++ - usual case
// //