summaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-12-21 13:24:58 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-12-21 13:24:58 +0000
commite865e81d34efb96417c549e9c326fb1c46dafbc7 (patch)
tree33ba50881b34dcb0732763d0359ca9a50bdef99a /coreutils
parentbf66fbc8e2380717c1fab860cfc60c78582839dd (diff)
downloadbusybox-w32-e865e81d34efb96417c549e9c326fb1c46dafbc7.tar.gz
busybox-w32-e865e81d34efb96417c549e9c326fb1c46dafbc7.tar.bz2
busybox-w32-e865e81d34efb96417c549e9c326fb1c46dafbc7.zip
less: stop dying on bad regexps, quietly pipe data w/o
user interaction if stdout is not a tty. size optimizations
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/cat.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/coreutils/cat.c b/coreutils/cat.c
index db4d33dc5..d828b86ec 100644
--- a/coreutils/cat.c
+++ b/coreutils/cat.c
@@ -14,9 +14,12 @@
14 14
15int bb_cat(char **argv) 15int bb_cat(char **argv)
16{ 16{
17 static char *const argv_dash[] = { "-", NULL };
17 FILE *f; 18 FILE *f;
18 int retval = EXIT_SUCCESS; 19 int retval = EXIT_SUCCESS;
19 20
21 if (!*argv) argv = (char**) &argv_dash;
22
20 do { 23 do {
21 f = fopen_or_warn_stdin(*argv); 24 f = fopen_or_warn_stdin(*argv);
22 if (f) { 25 if (f) {
@@ -35,11 +38,6 @@ int bb_cat(char **argv)
35int cat_main(int argc, char **argv) 38int cat_main(int argc, char **argv)
36{ 39{
37 getopt32(argc, argv, "u"); 40 getopt32(argc, argv, "u");
38
39 argv += optind; 41 argv += optind;
40 if (!*argv) {
41 *--argv = "-";
42 }
43
44 return bb_cat(argv); 42 return bb_cat(argv);
45} 43}