From 1ec9c6393a43df9a61385c14f30ea2bae83bc0ec Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 17 Oct 2015 17:30:23 +0200 Subject: [PATCH] Don't reserve space for directories when scrubbing The offset in a directory FileInfo is an FST offset, not a disc offset. Treating it as a disc offset doesn't make sense. Directories don't take up space outside of the FST, so they don't need to be marked as used. The old behavior may have prevented some scrubbable areas from being scrubbed. --- Source/Core/DiscIO/DiscScrubber.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Source/Core/DiscIO/DiscScrubber.cpp b/Source/Core/DiscIO/DiscScrubber.cpp index e669a5f4b3..e6865b3373 100644 --- a/Source/Core/DiscIO/DiscScrubber.cpp +++ b/Source/Core/DiscIO/DiscScrubber.cpp @@ -312,10 +312,7 @@ bool ParsePartitionData(SPartition& _rPartition) for (SFileInfo file : filesystem->GetFileList()) { DEBUG_LOG(DISCIO, "%s", file.m_FullPath.empty() ? "/" : file.m_FullPath.c_str()); - // Just 1byte for directory? - it will end up reserving a cluster this way - if (file.m_NameOffset & 0x1000000) - MarkAsUsedE(_rPartition.Offset + _rPartition.Header.DataOffset, file.m_Offset, 1); - else + if ((file.m_NameOffset & 0x1000000) == 0) MarkAsUsedE(_rPartition.Offset + _rPartition.Header.DataOffset, file.m_Offset, file.m_FileSize); } }