diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2013-02-16 14:42:43 +0000 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2013-02-16 14:42:43 +0000 |
commit | 7548e75065063dae256d94e6c7f4f9f43bd7f210 (patch) | |
tree | f23b000f8822f6eb70249c1106a3275deaa03bac /src/shred.c | |
parent | ddefcddae2e97579f82320f4fd70d0ba14a52392 (diff) | |
parent | 974ab3dd887985e3aa347f3c6521f819296396a0 (diff) | |
download | coreutils-7548e75065063dae256d94e6c7f4f9f43bd7f210.tar.gz |
Merge tag 'upstream/8.21'
Upstream version 8.21
Diffstat (limited to 'src/shred.c')
-rw-r--r-- | src/shred.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/shred.c b/src/shred.c index 7a282601..9b869cdc 100644 --- a/src/shred.c +++ b/src/shred.c @@ -1,6 +1,6 @@ /* shred.c - overwrite files and devices to make it harder to recover data - Copyright (C) 1999-2012 Free Software Foundation, Inc. + Copyright (C) 1999-2013 Free Software Foundation, Inc. Copyright (C) 1997, 1998, 1999 Colin Plumb. This program is free software: you can redistribute it and/or modify @@ -148,11 +148,10 @@ usage (int status) fputs (_("\ Overwrite the specified FILE(s) repeatedly, in order to make it harder\n\ for even very expensive hardware probing to recover the data.\n\ -\n\ -"), stdout); - fputs (_("\ -Mandatory arguments to long options are mandatory for short options too.\n\ "), stdout); + + emit_mandatory_arg_note (); + printf (_("\ -f, --force change permissions to allow writing if necessary\n\ -n, --iterations=N overwrite N times instead of the default (%d)\n\ @@ -485,10 +484,11 @@ dopass (int fd, char const *qname, off_t *sizep, int type, offset += soff; + bool done = offset == size; + /* Time to print progress? */ - if (n - && ((offset == size && *previous_human_offset) - || thresh <= (now = time (NULL)))) + if (n && ((done && *previous_human_offset) + || thresh <= (now = time (NULL)))) { char offset_buf[LONGEST_HUMAN_READABLE + 1]; char size_buf[LONGEST_HUMAN_READABLE + 1]; @@ -498,8 +498,7 @@ dopass (int fd, char const *qname, off_t *sizep, int type, = human_readable (offset, offset_buf, human_floor | human_progress_opts, 1, 1); - if (offset == size - || !STREQ (previous_human_offset, human_offset)) + if (done || !STREQ (previous_human_offset, human_offset)) { if (size < 0) error (0, 0, _("%s: pass %lu/%lu (%s)...%s"), @@ -516,7 +515,7 @@ dopass (int fd, char const *qname, off_t *sizep, int type, = human_readable (size, size_buf, human_ceiling | human_progress_opts, 1, 1); - if (offset == size) + if (done) human_offset = human_size; error (0, 0, _("%s: pass %lu/%lu (%s)...%s/%s %d%%"), qname, k, n, pass_string, human_offset, human_size, |