aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-02-08 18:34:03 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2011-02-08 18:34:03 +0100
commit92e531458a6c0e6464fbdc1463f91edc7fb752c7 (patch)
tree72062fc0e07619658d45b88172f230fc0ab34422 /coreutils
parent12d97b66805f87e535962963e858fc2422ffdbc7 (diff)
downloadbusybox-w32-1_18_3.tar.gz
busybox-w32-1_18_3.tar.bz2
busybox-w32-1_18_3.zip
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')
-rw-r--r--coreutils/wc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/coreutils/wc.c b/coreutils/wc.c
index fe3f274f8..6e22c66c8 100644
--- a/coreutils/wc.c
+++ b/coreutils/wc.c
@@ -81,11 +81,11 @@
81 * column order in "wc -cmlwL" output: 81 * column order in "wc -cmlwL" output:
82 */ 82 */
83enum { 83enum {
84 WC_LINES = 0, 84 WC_LINES = 0, /* -l */
85 WC_WORDS = 1, 85 WC_WORDS = 1, /* -w */
86 WC_UNICHARS = 2, 86 WC_UNICHARS = 2, /* -m */
87 WC_CHARS = 3, 87 WC_BYTES = 3, /* -c */
88 WC_LENGTH = 4, 88 WC_LENGTH = 4, /* -L */
89 NUM_WCS = 5, 89 NUM_WCS = 5,
90}; 90};
91 91
@@ -104,10 +104,10 @@ int wc_main(int argc UNUSED_PARAM, char **argv)
104 104
105 init_unicode(); 105 init_unicode();
106 106
107 print_type = getopt32(argv, "lwcmL"); 107 print_type = getopt32(argv, "lwmcL");
108 108
109 if (print_type == 0) { 109 if (print_type == 0) {
110 print_type = (1 << WC_LINES) | (1 << WC_WORDS) | (1 << WC_CHARS); 110 print_type = (1 << WC_LINES) | (1 << WC_WORDS) | (1 << WC_BYTES);
111 } 111 }
112 112
113 argv += optind; 113 argv += optind;
@@ -157,7 +157,7 @@ int wc_main(int argc UNUSED_PARAM, char **argv)
157 } 157 }
158 158
159 /* Cater for -c and -m */ 159 /* Cater for -c and -m */
160 ++counts[WC_CHARS]; 160 ++counts[WC_BYTES];
161 if (unicode_status != UNICODE_ON /* every byte is a new char */ 161 if (unicode_status != UNICODE_ON /* every byte is a new char */
162 || (c & 0xc0) != 0x80 /* it isn't a 2nd+ byte of a Unicode char */ 162 || (c & 0xc0) != 0x80 /* it isn't a 2nd+ byte of a Unicode char */
163 ) { 163 ) {