aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-11-26 05:43:16 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2009-11-26 05:43:16 +0100
commit5b6fe34cee9ccb70e813a1c3844c8d35fb708cbe (patch)
tree70fbf57d13fea8c1498a2aec093877f6fc3ec91e /coreutils
parentfa1e7177fbd442f15e31cf96113b582753764de7 (diff)
downloadbusybox-w32-5b6fe34cee9ccb70e813a1c3844c8d35fb708cbe.tar.gz
busybox-w32-5b6fe34cee9ccb70e813a1c3844c8d35fb708cbe.tar.bz2
busybox-w32-5b6fe34cee9ccb70e813a1c3844c8d35fb708cbe.zip
split: handle - as "use stdin". +13 bytes. Closes bug 741.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/cksum.c4
-rw-r--r--coreutils/split.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/coreutils/cksum.c b/coreutils/cksum.c
index 3a77c753a..8e65b1ca3 100644
--- a/coreutils/cksum.c
+++ b/coreutils/cksum.c
@@ -4,8 +4,8 @@
4 * 4 *
5 * Copyright (C) 2006 by Rob Sullivan, with ideas from code by Walter Harms 5 * Copyright (C) 2006 by Rob Sullivan, with ideas from code by Walter Harms
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. */ 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
8 8 */
9#include "libbb.h" 9#include "libbb.h"
10 10
11int cksum_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 11int cksum_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/coreutils/split.c b/coreutils/split.c
index 2191f30ea..c2f388501 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 }