aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2003-11-20 05:58:26 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2003-11-20 05:58:26 +0000
commit5c069aaf2f3a6848cb9c30c1e9e47069d48cd2f3 (patch)
tree47dfc56f4e99f1c0bcf03cb39fd875946bf4c0fd /coreutils
parentd85421de223905cbf23bc409a34cd5324b3128a6 (diff)
downloadbusybox-5c069aaf2f3a6848cb9c30c1e9e47069d48cd2f3.tar.gz
Fix up the -s option, and make usage consitent with behaviour,
patch by Steven Scholz
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/md5_sha1_sum.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/coreutils/md5_sha1_sum.c b/coreutils/md5_sha1_sum.c
index 42a1d7acf..b5e29cd72 100644
--- a/coreutils/md5_sha1_sum.c
+++ b/coreutils/md5_sha1_sum.c
@@ -143,16 +143,18 @@ extern int hash_files(int argc, char **argv, const uint8_t hash_algo)
hash_value = hash_file(filename_ptr, hash_algo);
if (hash_value && (strcmp(hash_value, line) == 0)) {
- printf("%s: OK\n", filename_ptr);
+ if (!(flags & FLAG_SILENT))
+ printf("%s: OK\n", filename_ptr);
} else {
- printf("%s: FAILED\n", filename_ptr);
+ if (!(flags & FLAG_SILENT))
+ printf("%s: FAILED\n", filename_ptr);
count_failed++;
}
/* possible free(NULL) */
free(hash_value);
free(line);
}
- if (count_failed) {
+ if (count_failed && !(flags & FLAG_SILENT)) {
bb_error_msg("WARNING: %d of %d computed checksums did NOT match",
count_failed, count_total);
}
@@ -178,10 +180,7 @@ extern int hash_files(int argc, char **argv, const uint8_t hash_algo)
if (hash_value == NULL) {
return_value++;
} else {
-#ifdef CONFIG_FEATURE_MD5_SHA1_SUM_CHECK
- if (!flags & FLAG_SILENT)
-#endif
- printf("%s %s\n", hash_value, file_ptr);
+ printf("%s %s\n", hash_value, file_ptr);
free(hash_value);
}
}