aboutsummaryrefslogtreecommitdiff
path: root/coreutils/wc.c
diff options
context:
space:
mode:
authorGravatar Denis Vlasenko <vda.linux@googlemail.com>2006-09-29 23:41:59 +0000
committerGravatar Denis Vlasenko <vda.linux@googlemail.com>2006-09-29 23:41:59 +0000
commit70210168fcb1fb9bdbcd6fe92509cd9b1ef46eb9 (patch)
tree6a277dce1252ee2625563c718fdc60b4c3a5a91f /coreutils/wc.c
parent3ed001ff2631ad6911096148f47a2719a5b6d4f4 (diff)
downloadbusybox-70210168fcb1fb9bdbcd6fe92509cd9b1ef46eb9.tar.gz
busybox-70210168fcb1fb9bdbcd6fe92509cd9b1ef46eb9.tar.bz2
wc: optionally support very large files in wc
Diffstat (limited to 'coreutils/wc.c')
-rw-r--r--coreutils/wc.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/coreutils/wc.c b/coreutils/wc.c
index 78a5105da..6ddac4dec 100644
--- a/coreutils/wc.c
+++ b/coreutils/wc.c
@@ -55,10 +55,13 @@
#define isspace_given_isprint(c) ((c) == ' ')
#endif
-//#define COUNT_T unsigned long long
-//#define COUNT_FMT "llu"
+#if ENABLE_FEATURE_WC_LARGE
+#define COUNT_T unsigned long long
+#define COUNT_FMT "llu"
+#else
#define COUNT_T unsigned
#define COUNT_FMT "u"
+#endif
enum {
WC_LINES = 0,
@@ -82,7 +85,7 @@ int wc_main(int argc, char **argv)
int c;
char status = EXIT_SUCCESS;
char in_word;
- char print_type;
+ unsigned print_type;
print_type = bb_getopt_ulflags(argc, argv, "lwcL");
@@ -115,6 +118,8 @@ int wc_main(int argc, char **argv)
in_word = 0;
do {
+ /* Our -w doesn't match GNU wc exactly... oh well */
+
++counts[WC_CHARS];
c = getc(fp);
if (isprint(c)) {