diff options
author | Elliott Hughes <enh@google.com> | 2016-01-08 19:13:38 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2016-01-08 19:13:38 -0600 |
commit | 8784d8d968c72328db11a72d50c836fc1650fa9a (patch) | |
tree | e7e1c05fbfaac96b8ce0feeb87fbf100afad02e1 /lib | |
parent | 0229ee428b00857b7978be1aae957839e8f00ca3 (diff) | |
download | toybox-8784d8d968c72328db11a72d50c836fc1650fa9a.tar.gz |
Fix cat -.
Commit 4b4ab6a50998 broke loopfiles' handling of "-".
This broke the existing cat tests, so no new test is necessary here.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lib.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -548,12 +548,12 @@ void loopfiles_rw(char **argv, int flags, int permissions, int failok, // Inability to open a file prints a warning, but doesn't exit. if (!strcmp(*argv, "-")) fd=0; - else if (0>(fd = open(*argv, flags, permissions)) && !failok) + else if (0>(fd = open(*argv, flags, permissions)) && !failok) { perror_msg_raw(*argv); - else { - function(fd, *argv); - if (flags & O_CLOEXEC) close(fd); + continue; } + function(fd, *argv); + if (flags & O_CLOEXEC) close(fd); } while (*++argv); } |