aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-02-06 13:53:21 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-02-06 13:53:21 +0100
commit6aca76d4d770bf2a0c252bc54733c2dbb269fc43 (patch)
tree3ebf07d7c4e79892c3c15da41a5b0c235a32f467
parentb741cd28d183b45e8e274027dc860c1711da4454 (diff)
downloadbusybox-w32-6aca76d4d770bf2a0c252bc54733c2dbb269fc43.tar.gz
busybox-w32-6aca76d4d770bf2a0c252bc54733c2dbb269fc43.tar.bz2
busybox-w32-6aca76d4d770bf2a0c252bc54733c2dbb269fc43.zip
hexdump: fix "hexdump nonexistent_file" handling
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--libbb/dump.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libbb/dump.c b/libbb/dump.c
index 49e5e26f8..7a87219ba 100644
--- a/libbb/dump.c
+++ b/libbb/dump.c
@@ -349,16 +349,16 @@ static NOINLINE int next(priv_dumper_t *dumper)
349 349
350 for (;;) { 350 for (;;) {
351 if (*dumper->argv) { 351 if (*dumper->argv) {
352 dumper->next__done = statok = 1;
352 if (!(freopen(*dumper->argv, "r", stdin))) { 353 if (!(freopen(*dumper->argv, "r", stdin))) {
353 bb_simple_perror_msg(*dumper->argv); 354 bb_simple_perror_msg(*dumper->argv);
354 dumper->exitval = 1; 355 dumper->exitval = 1;
355 ++dumper->argv; 356 ++dumper->argv;
356 continue; 357 continue;
357 } 358 }
358 dumper->next__done = statok = 1;
359 } else { 359 } else {
360 if (dumper->next__done) 360 if (dumper->next__done)
361 return 0; 361 return 0; /* no next file */
362 dumper->next__done = 1; 362 dumper->next__done = 1;
363 statok = 0; 363 statok = 0;
364 } 364 }