Skip to content
Prev Previous commit
Next Next commit
GetLength: fix reading from uninitialized cache.
  • Loading branch information
tmds committed Oct 9, 2021
commit 8a0edcd2bf1e2fd8b872a2656f4da4e3299a6abf
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ private unsafe void SetAccessOrWriteTime(string path, DateTimeOffset time, bool
internal long GetLength(ReadOnlySpan<char> path, bool continueOnError = false)
{
EnsureCachesInitialized(path, continueOnError);
return _fileCache.Size;
return IsFileCacheInitialized ? _fileCache.Size : 0;
}

// Tries to refresh the lstat cache (_fileCache).
Expand Down