projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gz_open and gz_close were left in, even when BB_FEATURE_TAR_GZIP was disabled.
[oweals/busybox.git]
/
md5sum.c
diff --git
a/md5sum.c
b/md5sum.c
index fa11ee61da28176284cc4a7cd55948d5d774227e..ac34623346ed9c0027cd192e005a008f5d00785d 100644
(file)
--- a/
md5sum.c
+++ b/
md5sum.c
@@
-819,8
+819,6
@@
int md5sum_main(int argc,
if (string == NULL)
string = (char **) xmalloc ((argc - 1) * sizeof (char *));
if (string == NULL)
string = (char **) xmalloc ((argc - 1) * sizeof (char *));
- if (optarg == NULL)
- optarg = "";
string[n_strings++] = optarg;
break;
}
string[n_strings++] = optarg;
break;
}
@@
-901,7
+899,12
@@
int md5sum_main(int argc,
fail = md5_file (file, binary, md5buffer);
err |= fail;
fail = md5_file (file, binary, md5buffer);
err |= fail;
- if (!fail) {
+ if (!fail && STREQ(file, "-")) {
+ size_t i;
+ for (i = 0; i < 16; ++i)
+ printf ("%02x", md5buffer[i]);
+ putchar ('\n');
+ } else if (!fail) {
size_t i;
/* Output a leading backslash if the file name contains
a newline or backslash. */
size_t i;
/* Output a leading backslash if the file name contains
a newline or backslash. */