summaryrefslogtreecommitdiff
path: root/coreutils/catv.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/catv.c')
-rw-r--r--coreutils/catv.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/coreutils/catv.c b/coreutils/catv.c
index a5ee534..b87740e 100644
--- a/coreutils/catv.c
+++ b/coreutils/catv.c
@@ -27,18 +27,14 @@ int catv_main(int argc ATTRIBUTE_UNUSED, char **argv)
argv += optind;
/* Read from stdin if there's nothing else to do. */
- fd = 0;
- if (!argv[0]) {
- argv--;
- goto jump_in;
- }
+ if (!argv[0])
+ *--argv = (char*)"-";
do {
- fd = open_or_warn(*argv, O_RDONLY);
+ fd = open_or_warn_stdin(*argv);
if (fd < 0) {
retval = EXIT_FAILURE;
continue;
}
- jump_in:
for (;;) {
int i, res;