aboutsummaryrefslogtreecommitdiff
path: root/coreutils/wc.c
diff options
context:
space:
mode:
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 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 ) {