Skip to content

Commit fe6eff2

Browse files
Fix logic error
1 parent a06825b commit fe6eff2

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

SabreTools.Serialization/Wrappers/RAR.Extraction.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,12 @@ public bool Extract(string outputDirectory, bool lookForHeader, bool includeDebu
7474
continue;
7575

7676
if (firstFile)
77+
{
7778
firstFile = false;
78-
else if (entry.IsSolid)
79+
continue;
80+
}
81+
82+
if (entry.IsSolid)
7983
{
8084
// If the RAR is solid and the first entry is password-protected, you won't be able to
8185
// extract the rest of the entries anyway, so just return early.
@@ -86,8 +90,9 @@ public bool Extract(string outputDirectory, bool lookForHeader, bool includeDebu
8690
}
8791

8892
isSolid = true;
89-
break;
9093
}
94+
95+
break;
9196
}
9297
catch (Exception ex)
9398
{

SabreTools.Serialization/Wrappers/SevenZip.Extraction.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,12 @@ public bool Extract(string outputDirectory, bool lookForHeader, bool includeDebu
7373
continue;
7474

7575
if (firstFile)
76+
{
7677
firstFile = false;
77-
else if (entry.IsSolid)
78+
continue;
79+
}
80+
81+
if (entry.IsSolid)
7882
{
7983
// If the 7z is solid and the first entry is password-protected, you won't be able to
8084
// extract the rest of the entries anyway, so just return early.
@@ -85,8 +89,9 @@ public bool Extract(string outputDirectory, bool lookForHeader, bool includeDebu
8589
}
8690

8791
isSolid = true;
88-
break;
8992
}
93+
94+
break;
9095
}
9196
catch (Exception ex)
9297
{

0 commit comments

Comments
 (0)