summaryrefslogtreecommitdiff
path: root/coreutils/wc.c
diff options
context:
space:
mode:
authorDenys Vlasenko2011-02-08 18:34:03 +0100
committerDenys Vlasenko2011-02-08 18:34:03 +0100
commit92e531458a6c0e6464fbdc1463f91edc7fb752c7 (patch)
tree72062fc0e07619658d45b88172f230fc0ab34422 /coreutils/wc.c
parent12d97b66805f87e535962963e858fc2422ffdbc7 (diff)
downloadbusybox-92e531458a6c0e6464fbdc1463f91edc7fb752c7.zip
busybox-92e531458a6c0e6464fbdc1463f91edc7fb752c7.tar.gz
Apply post-1.18.2 fixes, bump version to 1.18.31_18_3
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils/wc.c')
-rw-r--r--coreutils/wc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/coreutils/wc.c b/coreutils/wc.c
index fe3f274..6e22c66 100644
--- a/coreutils/wc.c
+++ b/coreutils/wc.c
@@ -81,11 +81,11 @@
* column order in "wc -cmlwL" output:
*/
enum {
- WC_LINES = 0,
- WC_WORDS = 1,
- WC_UNICHARS = 2,
- WC_CHARS = 3,
- WC_LENGTH = 4,
+ WC_LINES = 0, /* -l */
+ WC_WORDS = 1, /* -w */
+ WC_UNICHARS = 2, /* -m */
+ WC_BYTES = 3, /* -c */
+ WC_LENGTH = 4, /* -L */
NUM_WCS = 5,
};
@@ -104,10 +104,10 @@ int wc_main(int argc UNUSED_PARAM, char **argv)
init_unicode();
- print_type = getopt32(argv, "lwcmL");
+ print_type = getopt32(argv, "lwmcL");
if (print_type == 0) {
- print_type = (1 << WC_LINES) | (1 << WC_WORDS) | (1 << WC_CHARS);
+ print_type = (1 << WC_LINES) | (1 << WC_WORDS) | (1 << WC_BYTES);
}
argv += optind;
@@ -157,7 +157,7 @@ int wc_main(int argc UNUSED_PARAM, char **argv)
}
/* Cater for -c and -m */
- ++counts[WC_CHARS];
+ ++counts[WC_BYTES];
if (unicode_status != UNICODE_ON /* every byte is a new char */
|| (c & 0xc0) != 0x80 /* it isn't a 2nd+ byte of a Unicode char */
) {