diff options
Diffstat (limited to 'coreutils/split.c')
-rw-r--r-- | coreutils/split.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/coreutils/split.c b/coreutils/split.c index f1ec64be0..55927a491 100644 --- a/coreutils/split.c +++ b/coreutils/split.c | |||
@@ -79,9 +79,13 @@ int split_main(int argc UNUSED_PARAM, char **argv) | |||
79 | 79 | ||
80 | argv += optind; | 80 | argv += optind; |
81 | if (argv[0]) { | 81 | if (argv[0]) { |
82 | int fd; | ||
82 | if (argv[1]) | 83 | if (argv[1]) |
83 | sfx = argv[1]; | 84 | sfx = argv[1]; |
84 | xmove_fd(xopen(argv[0], O_RDONLY), 0); | 85 | fd = open_or_warn_stdin(argv[0]); |
86 | if (fd == -1) | ||
87 | return EXIT_FAILURE; | ||
88 | xmove_fd(fd, STDIN_FILENO); | ||
85 | } else { | 89 | } else { |
86 | argv[0] = (char *) bb_msg_standard_input; | 90 | argv[0] = (char *) bb_msg_standard_input; |
87 | } | 91 | } |