*sum: support - when using -c
Signed-off-by: Mattias Andrée <maandree@kth.se>
This commit is contained in:
parent
75611997f9
commit
44a6d65832
|
@ -89,12 +89,15 @@ cryptcheck(int argc, char *argv[], struct crypt_ops *ops, uint8_t *md, size_t sz
|
||||||
mdchecklist(stdin, ops, md, sz, &formatsucks, &noread, &nonmatch);
|
mdchecklist(stdin, ops, md, sz, &formatsucks, &noread, &nonmatch);
|
||||||
} else {
|
} else {
|
||||||
for (; *argv; argc--, argv++) {
|
for (; *argv; argc--, argv++) {
|
||||||
if (!(fp = fopen(*argv, "r"))) {
|
if ((*argv)[0] == '-' && !(*argv)[1]) {
|
||||||
|
fp = stdin;
|
||||||
|
} else if (!(fp = fopen(*argv, "r"))) {
|
||||||
weprintf("fopen %s:", *argv);
|
weprintf("fopen %s:", *argv);
|
||||||
ret = 1;
|
ret = 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
mdchecklist(fp, ops, md, sz, &formatsucks, &noread, &nonmatch);
|
mdchecklist(fp, ops, md, sz, &formatsucks, &noread, &nonmatch);
|
||||||
|
if (fp != stdin)
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user