Skip to content

Commit

Permalink
Fixed tar extracting on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyrdacor committed Jun 16, 2022
1 parent e498b8f commit 8ee938c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 0 additions & 3 deletions AmbermoonPatcher/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
{
Console.WriteLine("Unable to update Ambermoon.net as it is still running.");
Console.WriteLine("Please close all instances and run only a single Ambermoon.net instance.");
Console.ReadLine();
return;
}
}
Expand All @@ -42,7 +41,6 @@
{
Console.WriteLine("The downloaded zip does not contain the game exe.");
Console.WriteLine("Please report that to Pyrdacor ([email protected]).");
Console.ReadLine();
return;
}

Expand All @@ -59,7 +57,6 @@
#if DEBUG
Console.WriteLine(ex.ToString());
#endif
Console.ReadLine();
return;
}

Expand Down
6 changes: 5 additions & 1 deletion AmbermoonPatcher/Tar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static void ExtractTarGz(Stream stream, string outputDir, Func<string, bo
read = gzip.Read(buffer, 0, chunk);
ms.Write(buffer, 0, read);
}
while (read == chunk);
while (read != 0);

ms.Seek(0, SeekOrigin.Begin);
ExtractTar(ms, outputDir, filter);
Expand Down Expand Up @@ -95,6 +95,10 @@ public static void ExtractTar(Stream stream, string outputDir, Func<string, bool
stream.Read(blob, 0, blob.Length);
fs.Write(blob, 0, blob.Length);
}
else if (size != 0)
{
stream.Seek(size, SeekOrigin.Current);
}

var pos = stream.Position;

Expand Down

0 comments on commit 8ee938c

Please sign in to comment.