summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko2021-06-18 00:32:29 +0200
committerDenys Vlasenko2021-06-18 00:32:29 +0200
commit25fe2d50bd75097861db9eac8c8c9f238283ff5f (patch)
treeb384270c881c164644a4ea1a9a641885e090e072
parent4d1616179745ee3883a726aaf13468e9c44dff9e (diff)
downloadbusybox-25fe2d50bd75097861db9eac8c8c9f238283ff5f.zip
busybox-25fe2d50bd75097861db9eac8c8c9f238283ff5f.tar.gz
xxd: do not try reading from closed stdin when non-existent file is given
Was: xxd: FILE: No such file or directory xxd: FILE: Bad file descriptor function old new delta next 276 278 +2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--libbb/dump.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libbb/dump.c b/libbb/dump.c
index 8c2a370..9c16f1f 100644
--- a/libbb/dump.c
+++ b/libbb/dump.c
@@ -357,6 +357,7 @@ static NOINLINE int next(priv_dumper_t *dumper)
if (!freopen(fname, "r", stdin)) {
bb_simple_perror_msg(fname);
dumper->exitval = 1;
+ dumper->next__done = 1;
continue;
}
}