From 2df401cd5d881937028d56bc3c771c13238c3ef7 Mon Sep 17 00:00:00 2001 From: HowToDoThis Date: Thu, 12 Aug 2021 02:48:54 +0800 Subject: [PATCH] PR #645 --- src/ICSharpCode.SharpZipLib/Core/PathUtils.cs | 2 +- src/ICSharpCode.SharpZipLib/Tar/TarArchive.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ICSharpCode.SharpZipLib/Core/PathUtils.cs b/src/ICSharpCode.SharpZipLib/Core/PathUtils.cs index ddffbfda..95a8af12 100644 --- a/src/ICSharpCode.SharpZipLib/Core/PathUtils.cs +++ b/src/ICSharpCode.SharpZipLib/Core/PathUtils.cs @@ -35,7 +35,7 @@ public static string DropPathRoot(string path) /// /// If specified, used as the base file name for the temporary file /// Returns a temporary file name - public static string GetTempFileName(string orig) + public static string GetTempFileName(string orig = null) { string fileName; var tempPath = Path.GetTempPath(); diff --git a/src/ICSharpCode.SharpZipLib/Tar/TarArchive.cs b/src/ICSharpCode.SharpZipLib/Tar/TarArchive.cs index f1bd8f9d..7f6d180e 100644 --- a/src/ICSharpCode.SharpZipLib/Tar/TarArchive.cs +++ b/src/ICSharpCode.SharpZipLib/Tar/TarArchive.cs @@ -803,7 +803,7 @@ private void WriteEntryCore(TarEntry sourceEntry, bool recurse) { if (!IsBinary(entryFilename)) { - tempFileName = Path.GetRandomFileName(); + tempFileName = PathUtils.GetTempFileName(); using (StreamReader inStream = File.OpenText(entryFilename)) {