Skip to content

Commit

Permalink
Remove resume file when decryption succeedes
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpclark committed Dec 6, 2017
1 parent 76cc45c commit d8cf25e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ pub fn aescrypt_core_loop<'a>(
// times would be very slow and difficult to implement in a threaded way.

aes_command(code.first().unwrap(), target);

ResumeFile::purge();
break;
}

Expand Down Expand Up @@ -190,6 +190,7 @@ pub fn unzip_core_loop<'a>(

let mut code = code.lock().unwrap();
if !code.is_empty() {
ResumeFile::purge();
return code.pop().unwrap();
}

Expand Down
1 change: 0 additions & 1 deletion src/resume.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ impl ResumeFile {
return ResumeKeyDB { rkeys: vec![] };
}

#[allow(dead_code)]
pub(crate) fn purge() {
let _a = fs::remove_file(".abrute");
let _b = fs::remove_file(".abrute.bak");
Expand Down

0 comments on commit d8cf25e

Please sign in to comment.