projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Trim help text a bit more
[oweals/busybox.git]
/
coreutils
/
cat.c
diff --git
a/coreutils/cat.c
b/coreutils/cat.c
index ed3f33650f4d04a6bd4f8edf00e32ee4ca50e04d..0024eb8d5e11262dd3061952043cf42a131765ed 100644
(file)
--- a/
coreutils/cat.c
+++ b/
coreutils/cat.c
@@
-10,27
+10,23
@@
/* BB_AUDIT SUSv3 compliant */
/* http://www.opengroup.org/onlinepubs/007904975/utilities/cat.html */
/* BB_AUDIT SUSv3 compliant */
/* http://www.opengroup.org/onlinepubs/007904975/utilities/cat.html */
-#include "
busybox
.h"
+#include "
libbb
.h"
/* This is a NOFORK applet. Be very careful! */
int bb_cat(char **argv)
{
/* This is a NOFORK applet. Be very careful! */
int bb_cat(char **argv)
{
- static const char *const argv_dash[] = { "-", NULL };
-
int fd;
int retval = EXIT_SUCCESS;
if (!*argv)
int fd;
int retval = EXIT_SUCCESS;
if (!*argv)
- argv = (char**) &argv_dash;
+ argv = (char**) &
bb_
argv_dash;
do {
do {
- fd = STDIN_FILENO;
- if (!LONE_DASH(*argv))
- fd = open_or_warn(*argv, O_RDONLY);
+ fd = open_or_warn_stdin(*argv);
if (fd >= 0) {
if (fd >= 0) {
- /* This is not a
n
xfunc - never exits */
+ /* This is not a xfunc - never exits */
off_t r = bb_copyfd_eof(fd, STDOUT_FILENO);
if (fd != STDIN_FILENO)
close(fd);
off_t r = bb_copyfd_eof(fd, STDOUT_FILENO);
if (fd != STDIN_FILENO)
close(fd);
@@
-43,10
+39,10
@@
int bb_cat(char **argv)
return retval;
}
return retval;
}
-int cat_main(int argc, char **argv);
-int cat_main(int argc, char **argv)
+int cat_main(int argc, char **argv)
MAIN_EXTERNALLY_VISIBLE
;
+int cat_main(int argc
UNUSED_PARAM
, char **argv)
{
{
- getopt32(arg
c, arg
v, "u");
+ getopt32(argv, "u");
argv += optind;
return bb_cat(argv);
}
argv += optind;
return bb_cat(argv);
}