From ac96e60763966ec01394fd3c0804dbf317aaa287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nils=20m=C3=A5s=C3=A9n?= Date: Wed, 30 Jun 2021 12:16:29 +0200 Subject: [PATCH] fix(tar): create translated files in temp (#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 77c4b07fc..b8d0dd409 100644 --- a/src/ICSharpCode.SharpZipLib/Core/PathUtils.cs +++ b/src/ICSharpCode.SharpZipLib/Core/PathUtils.cs @@ -36,7 +36,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 original) + public static string GetTempFileName(string original = null) { string fileName; var tempPath = Path.GetTempPath(); diff --git a/src/ICSharpCode.SharpZipLib/Tar/TarArchive.cs b/src/ICSharpCode.SharpZipLib/Tar/TarArchive.cs index 3ae5f7757..4b373fb64 100644 --- a/src/ICSharpCode.SharpZipLib/Tar/TarArchive.cs +++ b/src/ICSharpCode.SharpZipLib/Tar/TarArchive.cs @@ -824,7 +824,7 @@ private void WriteEntryCore(TarEntry sourceEntry, bool recurse) { if (!IsBinary(entryFilename)) { - tempFileName = Path.GetRandomFileName(); + tempFileName = PathUtils.GetTempFileName(); using (StreamReader inStream = File.OpenText(entryFilename)) {