Fix incorrect code in an example. The previous example would produce
19 column positions wide in the first line and 20 in the rest of the lines. This fixes the example to provide the correct output. PR: 53454 Noticed by: Kuang-che Wu <kcwu@kcwu.homeip.net> Submitted by: Marc Silver <marcs@draenor.org> Approved by: re (scottl)
This commit is contained in:
parent
2cfe973b62
commit
daa790840c
@ -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')
|
||||
|
Loading…
x
Reference in New Issue
Block a user