diff options
author | bug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2003-11-20 05:58:26 +0000 |
---|---|---|
committer | bug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2003-11-20 05:58:26 +0000 |
commit | 8678962f1b34030273c28a3662136bdda073c930 (patch) | |
tree | 47dfc56f4e99f1c0bcf03cb39fd875946bf4c0fd /coreutils | |
parent | e7829f5f43b935b15ef67c0e8f98f739ba4554ad (diff) | |
download | busybox-w32-8678962f1b34030273c28a3662136bdda073c930.tar.gz busybox-w32-8678962f1b34030273c28a3662136bdda073c930.tar.bz2 busybox-w32-8678962f1b34030273c28a3662136bdda073c930.zip |
Fix up the -s option, and make usage consitent with behaviour,
patch by Steven Scholz
git-svn-id: svn://busybox.net/trunk/busybox@7954 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/md5_sha1_sum.c | 13 |
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) | |||
143 | hash_value = hash_file(filename_ptr, hash_algo); | 143 | hash_value = hash_file(filename_ptr, hash_algo); |
144 | 144 | ||
145 | if (hash_value && (strcmp(hash_value, line) == 0)) { | 145 | if (hash_value && (strcmp(hash_value, line) == 0)) { |
146 | printf("%s: OK\n", filename_ptr); | 146 | if (!(flags & FLAG_SILENT)) |
147 | printf("%s: OK\n", filename_ptr); | ||
147 | } else { | 148 | } else { |
148 | printf("%s: FAILED\n", filename_ptr); | 149 | if (!(flags & FLAG_SILENT)) |
150 | printf("%s: FAILED\n", filename_ptr); | ||
149 | count_failed++; | 151 | count_failed++; |
150 | } | 152 | } |
151 | /* possible free(NULL) */ | 153 | /* possible free(NULL) */ |
152 | free(hash_value); | 154 | free(hash_value); |
153 | free(line); | 155 | free(line); |
154 | } | 156 | } |
155 | if (count_failed) { | 157 | if (count_failed && !(flags & FLAG_SILENT)) { |
156 | bb_error_msg("WARNING: %d of %d computed checksums did NOT match", | 158 | bb_error_msg("WARNING: %d of %d computed checksums did NOT match", |
157 | count_failed, count_total); | 159 | count_failed, count_total); |
158 | } | 160 | } |
@@ -178,10 +180,7 @@ extern int hash_files(int argc, char **argv, const uint8_t hash_algo) | |||
178 | if (hash_value == NULL) { | 180 | if (hash_value == NULL) { |
179 | return_value++; | 181 | return_value++; |
180 | } else { | 182 | } else { |
181 | #ifdef CONFIG_FEATURE_MD5_SHA1_SUM_CHECK | 183 | printf("%s %s\n", hash_value, file_ptr); |
182 | if (!flags & FLAG_SILENT) | ||
183 | #endif | ||
184 | printf("%s %s\n", hash_value, file_ptr); | ||
185 | free(hash_value); | 184 | free(hash_value); |
186 | } | 185 | } |
187 | } | 186 | } |