xxd: allow "-" as file name meaning stdin
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
10
libbb/dump.c
10
libbb/dump.c
@ -339,10 +339,12 @@ static NOINLINE int next(priv_dumper_t *dumper)
|
|||||||
|
|
||||||
if (fname) {
|
if (fname) {
|
||||||
dumper->argv++;
|
dumper->argv++;
|
||||||
if (!freopen(fname, "r", stdin)) {
|
if (NOT_LONE_DASH(fname)) {
|
||||||
bb_simple_perror_msg(fname);
|
if (!freopen(fname, "r", stdin)) {
|
||||||
dumper->exitval = 1;
|
bb_simple_perror_msg(fname);
|
||||||
continue;
|
dumper->exitval = 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (dumper->next__done)
|
if (dumper->next__done)
|
||||||
|
Reference in New Issue
Block a user