From 90678f0cd72e39806b159a551af85265608219b6 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 14 Jul 2017 16:29:30 +0200 Subject: [PATCH] xxd: allow "-" as file name meaning stdin Signed-off-by: Denys Vlasenko --- libbb/dump.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libbb/dump.c b/libbb/dump.c index 189277297..211a1ed9e 100644 --- a/libbb/dump.c +++ b/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) -- 2.25.1