7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 15:43:44 +00:00

Take file size into account in cache hash

Revision control systems can play games with file timestamps.  If the
file has changed size, we should reload it as well.

Fixes https://gitlab.com/kicad/code/kicad/issues/7627
This commit is contained in:
Seth Hillbrand 2021-02-20 06:19:36 -08:00
parent e89f9db438
commit d9d906e652

View File

@ -570,6 +570,7 @@ long long TimestampDir( const wxString& aDirPath, const wxString& aFilespec )
{
ConvertFileTimeToWx( &lastModDate, findData.ftLastWriteTime );
timestamp += lastModDate.GetValue().GetValue();
timestamp += findData.nFileSizeLow; // Get the file size (partial) as well to check for sneaky changes
}
while ( FindNextFile( fileHandle, &findData ) != 0 );
}
@ -620,7 +621,10 @@ long long TimestampDir( const wxString& aDirPath, const wxString& aFilespec )
}
if( S_ISREG( entry_stat.st_mode ) ) // wxFileExists()
{
timestamp += entry_stat.st_mtime * 1000;
timestamp += entry_stat.st_size; // Get the file size as well to check for sneaky changes
}
}
else
{