summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/locale/wcwidth.310
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/libc/locale/wcwidth.3 b/lib/libc/locale/wcwidth.3
index 06c0067..c87c7ed 100644
--- a/lib/libc/locale/wcwidth.3
+++ b/lib/libc/locale/wcwidth.3
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd August 12, 2004
+.Dd August 17, 2004
.Dt WCWIDTH 3
.Os
.Sh NAME
@@ -65,10 +65,16 @@ int column, w;
column = 0;
while ((ch = getwchar()) != WEOF) {
+<<<<<<< wcwidth.3
+ if ((w = wcwidth(ch)) > 0)
+ column += w;
+ if (column > 20) {
+=======
w = wcwidth(ch);
if (w > 0 && column + w >= 20) {
+>>>>>>> 1.4
putwchar(L'\en');
- column = 0;
+ column = w;
}
putwchar(ch);
if (ch == L'\en')
OpenPOWER on IntegriCloud