introduce LONE_CHAR (optimized strcmp with one-char string)
diff --git a/coreutils/cat.c b/coreutils/cat.c
index a959805..db4d33d 100644
--- a/coreutils/cat.c
+++ b/coreutils/cat.c
@@ -11,20 +11,12 @@
/* http://www.opengroup.org/onlinepubs/007904975/utilities/cat.html */
#include "busybox.h"
-#include <unistd.h>
-int cat_main(int argc, char **argv)
+int bb_cat(char **argv)
{
FILE *f;
int retval = EXIT_SUCCESS;
- getopt32(argc, argv, "u");
-
- argv += optind;
- if (!*argv) {
- *--argv = "-";
- }
-
do {
f = fopen_or_warn_stdin(*argv);
if (f) {
@@ -39,3 +31,15 @@
return retval;
}
+
+int cat_main(int argc, char **argv)
+{
+ getopt32(argc, argv, "u");
+
+ argv += optind;
+ if (!*argv) {
+ *--argv = "-";
+ }
+
+ return bb_cat(argv);
+}