mirror of
https://github.com/uutils/coreutils
synced 2024-11-15 09:27:21 +00:00
shred: only run zero when the file isn't empty
This commit is contained in:
parent
cf3fe0e566
commit
6d89f96d86
1 changed files with 5 additions and 4 deletions
|
@ -460,10 +460,11 @@ fn wipe_file(
|
|||
pass_sequence[i * (n_passes - 1) / (n_random - 1)] = PassType::Random;
|
||||
}
|
||||
}
|
||||
}
|
||||
// --zero specifies whether we want one final pass of 0x00 on our file
|
||||
if zero {
|
||||
pass_sequence.push(PassType::Pattern(PATTERNS[0]));
|
||||
|
||||
// --zero specifies whether we want one final pass of 0x00 on our file
|
||||
if zero {
|
||||
pass_sequence.push(PassType::Pattern(PATTERNS[0]));
|
||||
}
|
||||
}
|
||||
|
||||
let total_passes = pass_sequence.len();
|
||||
|
|
Loading…
Reference in a new issue