less: stop dying on bad regexps, quietly pipe data w/o

user interaction if stdout is not a tty.
size optimizations
This commit is contained in:
Denis Vlasenko
2006-12-21 13:24:58 +00:00
parent bf66fbc8e2
commit e865e81d34
4 changed files with 164 additions and 120 deletions

View File

@ -14,9 +14,12 @@
int bb_cat(char **argv)
{
static char *const argv_dash[] = { "-", NULL };
FILE *f;
int retval = EXIT_SUCCESS;
if (!*argv) argv = (char**) &argv_dash;
do {
f = fopen_or_warn_stdin(*argv);
if (f) {
@ -35,11 +38,6 @@ int bb_cat(char **argv)
int cat_main(int argc, char **argv)
{
getopt32(argc, argv, "u");
argv += optind;
if (!*argv) {
*--argv = "-";
}
return bb_cat(argv);
}