Permalink
Browse files

Merge pull request #152 from JacksonTech/master

Fixing FS::InternalLoadPak to only get timestamp for .dpk files.
  • Loading branch information...
illwieckz committed Jan 8, 2019
2 parents ea00e7d + 0b6d70f commit 66a062ec564be31ad4bef903a3d7bc7a39eda25c
Showing with 9 additions and 4 deletions.
  1. +9 −4 src/common/FileSystem.cpp
@@ -1142,10 +1142,15 @@ static void InternalLoadPak(const PakInfo& pak, Util::optional<uint32_t> expecte
// Save the real checksum in the list of loaded paks (empty for directories, not used for legacy paks)
loadedPaks.back().realChecksum = realChecksum;

// Get the timestamp of the pak
loadedPaks.back().timestamp = FS::RawPath::FileTimestamp(pak.path, err);
if (err)
return;
// Get the timestamp of the pak, but only for dpk files.
// Directories (aka a dpkdir) don't need timestamp.
// Fixes Windows bug where calling _wstat64i with trailing slash causes "file not found" error.
// For future stat calls on directories, trim the trailing slash (if exists)
if (pak.type == pakType_t::PAK_ZIP) {
loadedPaks.back().timestamp = FS::RawPath::FileTimestamp(pak.path, err);
if (err)
return;
}

loadedPaks.back().pathPrefix = pathPrefix;

0 comments on commit 66a062e

Please sign in to comment.