* for which 'wc -c' should output '0'.
*/
-#include "busybox.h"
+#include "libbb.h"
#ifdef CONFIG_LOCALE_SUPPORT
-#include <locale.h>
-#include <ctype.h>
#define isspace_given_isprint(c) isspace(c)
#else
#undef isspace
WC_LENGTH = 3
};
+int wc_main(int argc, char **argv);
int wc_main(int argc, char **argv)
{
FILE *fp;
unsigned u;
int num_files = 0;
int c;
- char status = EXIT_SUCCESS;
- char in_word;
+ smallint status = EXIT_SUCCESS;
+ smallint in_word;
unsigned print_type;
print_type = getopt32(argc, argv, "lwcL");
while ((arg = *argv++) != 0) {
++num_files;
- fp = bb_wfopen_input(arg);
+ fp = fopen_or_warn_stdin(arg);
if (!fp) {
status = EXIT_FAILURE;
continue;
}
totals[WC_LENGTH] -= counts[WC_LENGTH];
- bb_fclose_nonstdin(fp);
+ fclose_if_not_stdin(fp);
OUTPUT:
/* coreutils wc tries hard to print pretty columns