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
10
libbb/dump.c
10
libbb/dump.c
@ -339,10 +339,12 @@ static NOINLINE int next(priv_dumper_t *dumper)
|
||||
|
||||
if (fname) {
|
||||
dumper->argv++;
|
||||
if (!freopen(fname, "r", stdin)) {
|
||||
bb_simple_perror_msg(fname);
|
||||
dumper->exitval = 1;
|
||||
continue;
|
||||
if (NOT_LONE_DASH(fname)) {
|
||||
if (!freopen(fname, "r", stdin)) {
|
||||
bb_simple_perror_msg(fname);
|
||||
dumper->exitval = 1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (dumper->next__done)
|
||||
|
Loading…
Reference in New Issue
Block a user