docs/53454: wrong sample code in manpage of wcwidth(3)

Marc Silver marcs at draenor.org
Tue Feb 3 13:40:14 UTC 2004


The following reply was made to PR docs/53454; it has been noted by GNATS.

From: Marc Silver <marcs at draenor.org>
To: freebsd-gnats-submit at FreeBSD.org, kcwu at kcwu.homeip.net
Cc:  
Subject: Re: docs/53454: wrong sample code in manpage of wcwidth(3)
Date: Tue, 3 Feb 2004 13:34:28 +0000

 --Q0rSlbzrZN6k9QnT
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 Hi,
 
 I've tested the aforementioned patch, and it correctly outputs
 information now.  Perhaps someone could commit it?
 
 Diff attached.
 
 Cheers,
 Marc
 
 -- 
 Success is never final. Failure is never fatal. It is courage that
 counts.  
   -- Winston Churchill
 
 --Q0rSlbzrZN6k9QnT
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="wcwidth.3-patch"
 
 --- wcwidth.3-orig	Tue Feb  3 15:28:07 2004
 +++ wcwidth.3	Tue Feb  3 15:28:31 2004
 @@ -67,9 +67,9 @@
  while ((ch = getwchar()) != WEOF) {
  	if ((w = wcwidth(ch)) > 0)
  		column += w;
 -	if (column >= 20) {
 +	if (column > 20) {
  		putwchar(L'\en');
 -		column = 0;
 +		column = w;
  	}
  	putwchar(ch);
  	if (ch == L'\en')
 
 --Q0rSlbzrZN6k9QnT--



More information about the freebsd-doc mailing list