summaryrefslogtreecommitdiff
path: root/coreutils/split.c
diff options
context:
space:
mode:
authorDenys Vlasenko2009-11-26 05:43:16 +0100
committerDenys Vlasenko2009-11-26 05:43:16 +0100
commit5b6fe34cee9ccb70e813a1c3844c8d35fb708cbe (patch)
tree70fbf57d13fea8c1498a2aec093877f6fc3ec91e /coreutils/split.c
parentfa1e7177fbd442f15e31cf96113b582753764de7 (diff)
downloadbusybox-5b6fe34cee9ccb70e813a1c3844c8d35fb708cbe.zip
busybox-5b6fe34cee9ccb70e813a1c3844c8d35fb708cbe.tar.gz
split: handle - as "use stdin". +13 bytes. Closes bug 741.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils/split.c')
-rw-r--r--coreutils/split.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/coreutils/split.c b/coreutils/split.c
index 2191f30..c2f3885 100644
--- a/coreutils/split.c
+++ b/coreutils/split.c
@@ -79,9 +79,13 @@ int split_main(int argc UNUSED_PARAM, char **argv)
argv += optind;
if (argv[0]) {
+ int fd;
if (argv[1])
sfx = argv[1];
- xmove_fd(xopen(argv[0], O_RDONLY), 0);
+ fd = open_or_warn_stdin(argv[0]);
+ if (fd == -1)
+ return EXIT_FAILURE;
+ xmove_fd(fd, STDIN_FILENO);
} else {
argv[0] = (char *) bb_msg_standard_input;
}