summaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenys Vlasenko2017-07-14 16:29:30 +0200
committerDenys Vlasenko2017-07-14 16:29:30 +0200
commit90678f0cd72e39806b159a551af85265608219b6 (patch)
tree2e8a4ded953e717fe3d9da45d410cf4e80215ba1 /libbb
parent63214a68f1b553e09ae18956cd7e4ec9543535c5 (diff)
downloadbusybox-90678f0cd72e39806b159a551af85265608219b6.zip
busybox-90678f0cd72e39806b159a551af85265608219b6.tar.gz
xxd: allow "-" as file name meaning stdin
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r--libbb/dump.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libbb/dump.c b/libbb/dump.c
index 1892772..211a1ed 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)