Add support for multi-byte locales.
authorJim Meyering <jim@meyering.net>
Fri, 11 Aug 2000 09:20:31 +0000 (09:20 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 11 Aug 2000 09:20:31 +0000 (09:20 +0000)
commit19d6aed7605a022576323c574c78a3d24ff84516
tree1293385c09ad1367e1a2ac9ba40702502087e6a2
parentc14f06f708d40ddb91d1e1e73111500e3e9c979c
Add support for multi-byte locales.
(iswprint, mbrtowc, wcwidth): Provide default definitions.
(total_bytes): New variable.
(print_bytes): New variable.
(longopts): Change abbreviation for --chars from 'c' to 'm'.
(usage): Update.
(write_counts): Add `bytes' argument.
(wc): New variables `bytes', `count_bytes', `count_chars',
`count_complicated'. The old code determines `bytes', not `chars'.
New case for MB_CUR_MAX > 1. A non-printable non-space character does
not increment the line position or start a word. Update `total_bytes'.
(main): Initialize `print_bytes' and `total_bytes' to 0. Accept 'm'
option. Pass `total_bytes' to write_counts.
src/wc.c