xxd: allow "-" as file name meaning stdin
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
63214a68f1
commit
90678f0cd7
@ -339,11 +339,13 @@ static NOINLINE int next(priv_dumper_t *dumper)
|
||||
|
||||
if (fname) {
|
||||
dumper->argv++;
|
||||
if (NOT_LONE_DASH(fname)) {
|
||||
if (!freopen(fname, "r", stdin)) {
|
||||
bb_simple_perror_msg(fname);
|
||||
dumper->exitval = 1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (dumper->next__done)
|
||||
return 0; /* no next file */
|
||||
|
Loading…
Reference in New Issue
Block a user