wc: treat non breaking space as a word separator
commita5202bd58531923ea9f93cc35ddeec5e3a8e0189
authorPádraig Brady <P@draigBrady.com>
Sun, 24 Feb 2019 05:23:47 +0000 (23 21:23 -0800)
committerPádraig Brady <P@draigBrady.com>
Tue, 26 Feb 2019 06:49:44 +0000 (25 22:49 -0800)
treea7530c8d01d08dd8561c20b1512f330127d7090b
parent2ab2f7a422652a9ec887e08ca8935b44e9629505
wc: treat non breaking space as a word separator

* src/wc.c (iswnbspace): A new function to match
characters in this class.
(isnbspace): Likewise for single byte charsets.
(main): Initialize posixly_correct from the environment,
to allow disabling honoring NBSP in non C locales.
(wc): Call is[w]nbspace() along with is[w]space.
* bootstrap.conf: Ensure btowc is available.
* tests/misc/wc-nbsp.sh: A new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the change in behavior.
NEWS
bootstrap.conf
src/wc.c
tests/local.mk
tests/misc/wc-nbsp.sh [new file with mode: 0755]