diff --git a/BurnOutSharp/Scanner.cs b/BurnOutSharp/Scanner.cs index d6d13907..fd672456 100644 --- a/BurnOutSharp/Scanner.cs +++ b/BurnOutSharp/Scanner.cs @@ -465,7 +465,7 @@ namespace BurnOutSharp if (SevenZip.ShouldScan(magic)) { var subProtections = SevenZip.Scan(this, fs); - Utilities.PrependToKeys(protections, file); + Utilities.PrependToKeys(subProtections, file); Utilities.AppendToDictionary(protections, subProtections); } @@ -473,7 +473,7 @@ namespace BurnOutSharp if (BFPK.ShouldScan(magic)) { var subProtections = BFPK.Scan(this, fs); - Utilities.PrependToKeys(protections, file); + Utilities.PrependToKeys(subProtections, file); Utilities.AppendToDictionary(protections, subProtections); } @@ -481,7 +481,7 @@ namespace BurnOutSharp if (BZip2.ShouldScan(magic)) { var subProtections = BZip2.Scan(this, fs); - Utilities.PrependToKeys(protections, file); + Utilities.PrependToKeys(subProtections, file); Utilities.AppendToDictionary(protections, subProtections); } @@ -489,7 +489,7 @@ namespace BurnOutSharp if (GZIP.ShouldScan(magic)) { var subProtections = GZIP.Scan(this, fs); - Utilities.PrependToKeys(protections, file); + Utilities.PrependToKeys(subProtections, file); Utilities.AppendToDictionary(protections, subProtections); } @@ -497,7 +497,7 @@ namespace BurnOutSharp if (file != null && InstallShieldCAB.ShouldScan(magic)) { var subProtections = InstallShieldCAB.Scan(this, file); - Utilities.PrependToKeys(protections, file); + Utilities.PrependToKeys(subProtections, file); Utilities.AppendToDictionary(protections, subProtections); } @@ -505,7 +505,7 @@ namespace BurnOutSharp if (file != null && MicrosoftCAB.ShouldScan(magic)) { var subProtections = MicrosoftCAB.Scan(this, file); - Utilities.PrependToKeys(protections, file); + Utilities.PrependToKeys(subProtections, file); Utilities.AppendToDictionary(protections, subProtections); } @@ -513,7 +513,7 @@ namespace BurnOutSharp if (file != null && MSI.ShouldScan(magic)) { var subProtections = MSI.Scan(this, file); - Utilities.PrependToKeys(protections, file); + Utilities.PrependToKeys(subProtections, file); Utilities.AppendToDictionary(protections, subProtections); } @@ -521,7 +521,7 @@ namespace BurnOutSharp if (file != null && MPQ.ShouldScan(magic)) { var subProtections = MPQ.Scan(this, file); - Utilities.PrependToKeys(protections, file); + Utilities.PrependToKeys(subProtections, file); Utilities.AppendToDictionary(protections, subProtections); } @@ -529,7 +529,7 @@ namespace BurnOutSharp if (PKZIP.ShouldScan(magic)) { var subProtections = PKZIP.Scan(this, fs); - Utilities.PrependToKeys(protections, file); + Utilities.PrependToKeys(subProtections, file); Utilities.AppendToDictionary(protections, subProtections); } @@ -537,7 +537,7 @@ namespace BurnOutSharp if (RAR.ShouldScan(magic)) { var subProtections = RAR.Scan(this, fs); - Utilities.PrependToKeys(protections, file); + Utilities.PrependToKeys(subProtections, file); Utilities.AppendToDictionary(protections, subProtections); } @@ -545,7 +545,7 @@ namespace BurnOutSharp if (TapeArchive.ShouldScan(magic)) { var subProtections = TapeArchive.Scan(this, fs); - Utilities.PrependToKeys(protections, file); + Utilities.PrependToKeys(subProtections, file); Utilities.AppendToDictionary(protections, subProtections); } @@ -553,7 +553,7 @@ namespace BurnOutSharp if (file != null && Valve.ShouldScan(magic)) { var subProtections = Valve.Scan(this, file); - Utilities.PrependToKeys(protections, file); + Utilities.PrependToKeys(subProtections, file); Utilities.AppendToDictionary(protections, subProtections); } @@ -561,7 +561,7 @@ namespace BurnOutSharp if (XZ.ShouldScan(magic)) { var subProtections = XZ.Scan(this, fs); - Utilities.PrependToKeys(protections, file); + Utilities.PrependToKeys(subProtections, file); Utilities.AppendToDictionary(protections, subProtections); } } diff --git a/BurnOutSharp/Utilities.cs b/BurnOutSharp/Utilities.cs index 6c809b93..49418237 100644 --- a/BurnOutSharp/Utilities.cs +++ b/BurnOutSharp/Utilities.cs @@ -79,7 +79,7 @@ namespace BurnOutSharp return; // Use a placeholder value if the path is null - pathToPrepend = pathToPrepend ?? "ARCHIVE"; + pathToPrepend = (pathToPrepend ?? "ARCHIVE").TrimEnd(Path.DirectorySeparatorChar); // Get a list of all of the keys var keys = original.Keys.ToList(); @@ -91,7 +91,7 @@ namespace BurnOutSharp string currentKey = keys[i]; // Otherwise, get the new key name and transfer over - string newKey = Path.Combine(pathToPrepend, currentKey); + string newKey = $"{pathToPrepend}{Path.DirectorySeparatorChar}{currentKey.Trim(Path.DirectorySeparatorChar)}"; original[newKey] = original[currentKey]; original.Remove(currentKey); }