[git commit master] hexdump: fix "hexdump nonexistent_file" handling

Denys Vlasenko vda.linux at googlemail.com
Sat Feb 6 12:53:21 UTC 2010


commit: http://git.busybox.net/busybox/commit/?id=6aca76d4d770bf2a0c252bc54733c2dbb269fc43
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 libbb/dump.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libbb/dump.c b/libbb/dump.c
index 49e5e26..7a87219 100644
--- a/libbb/dump.c
+++ b/libbb/dump.c
@@ -349,16 +349,16 @@ static NOINLINE int next(priv_dumper_t *dumper)
 
 	for (;;) {
 		if (*dumper->argv) {
+			dumper->next__done = statok = 1;
 			if (!(freopen(*dumper->argv, "r", stdin))) {
 				bb_simple_perror_msg(*dumper->argv);
 				dumper->exitval = 1;
 				++dumper->argv;
 				continue;
 			}
-			dumper->next__done = statok = 1;
 		} else {
 			if (dumper->next__done)
-				return 0;
+				return 0; /* no next file */
 			dumper->next__done = 1;
 			statok = 0;
 		}
-- 
1.6.3.3



More information about the busybox-cvs mailing list