summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2017-02-19 23:45:46 +0000
committerschwarze <schwarze@openbsd.org>2017-02-19 23:45:46 +0000
commit332b6acdc1b8665dc100461a4bc42e810ea887e0 (patch)
tree065395cbe8345e87c595a3dc76e35ab73b4291fc
parentAssigning to RANDOM calls srand_deterministic(3), not srand(3), (diff)
downloadwireguard-openbsd-332b6acdc1b8665dc100461a4bc42e810ea887e0.tar.xz
wireguard-openbsd-332b6acdc1b8665dc100461a4bc42e810ea887e0.zip
Do not break the line at U+00A0 NO-BREAK SPACE.
Bug pointed out by Eric dot Pruitt at gmail dot com on misc@. OK millert@ bentley@
-rw-r--r--usr.bin/fmt/fmt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/fmt/fmt.c b/usr.bin/fmt/fmt.c
index a29accde429..607ec02e6ba 100644
--- a/usr.bin/fmt/fmt.c
+++ b/usr.bin/fmt/fmt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fmt.c,v 1.36 2016/01/07 18:02:43 schwarze Exp $ */
+/* $OpenBSD: fmt.c,v 1.37 2017/02/19 23:45:46 schwarze Exp $ */
/* Sensible version of fmt
*
@@ -468,7 +468,7 @@ process_stream(FILE *stream, const char *name)
tab_width - line_width;
else if ((wcw = wcwidth(wc)) == -1)
wcw = 1;
- if (iswblank(wc)) {
+ if (iswblank(wc) && wc != 0xa0) {
/* Skip whitespace at start of line. */
if (word_length == 0) {
wordp += wcl;