From 9c8b71f3f45f783572d47a1be3b0670a60e89ea8 Mon Sep 17 00:00:00 2001 From: Evan Su <48808396+HACKERALERT@users.noreply.github.com> Date: Mon, 16 May 2022 16:10:58 -0400 Subject: [PATCH] Fix bug when deleting files --- src/Picocrypt.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Picocrypt.go b/src/Picocrypt.go index 8beb0dd..89721b4 100644 --- a/src/Picocrypt.go +++ b/src/Picocrypt.go @@ -74,6 +74,7 @@ var showProgress bool // Input and output files var inputFile string +var inputFileOld string var outputFile string var onlyFiles []string var onlyFolders []string @@ -996,6 +997,7 @@ func work() { fin.Close() } fout.Close() + inputFileOld = inputFile inputFile = outputFile + ".pcv" } @@ -1634,11 +1636,11 @@ func work() { if recombine { // Remove each chunk i := 0 for { - _, err := os.Stat(fmt.Sprintf("%s.%d", inputFile, i)) + _, err := os.Stat(fmt.Sprintf("%s.%d", inputFileOld, i)) if err != nil { break } - os.Remove(fmt.Sprintf("%s.%d", inputFile, i)) + os.Remove(fmt.Sprintf("%s.%d", inputFileOld, i)) i++ } } else { @@ -1701,6 +1703,7 @@ func resetUI() { mode = "" inputFile = "" + inputFileOld = "" outputFile = "" onlyFiles = nil onlyFolders = nil