X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/c65df27983057ec76ed0e72bb370f9a5ae7dad28..298182ad446aaced14dea7ed0e7c968946787288:/hashsum.c diff --git a/hashsum.c b/hashsum.c index c9bb3ec..85fc6f4 100644 --- a/hashsum.c +++ b/hashsum.c @@ -211,7 +211,7 @@ static int fhash(const char *file, unsigned f, const gchash *gch, void *buf) ghash *h; int e; - if (!file) + if (!file || strcmp(file, "-") == 0) fp = stdin; else if ((fp = fopen(file, f & f_binary ? "rb" : "r")) == 0) return (-1); @@ -441,7 +441,7 @@ static int checkhash(const char *file, unsigned f, unsigned long n = 0, nfail = 0; octet *buf = xmalloc(2 * gch->hashsz); - if (!file) + if (!file || strcmp(file, "-") == 0) fp = stdin; else if ((fp = fopen(file, f & f_raw ? "r" : "rb")) == 0) { moan("couldn't open `%s': %s", file, strerror(errno)); @@ -571,7 +571,7 @@ static int hashfiles(const char *file, unsigned f, int rc = 0; int rrc; - if (!file) + if (!file || strcmp(file, "-") == 0) fp = stdin; else if ((fp = fopen(file, f & f_raw ? "r" : "rb")) == 0) { moan("couldn't open `%s': %s", file, strerror(errno));