9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] tcs bug fixed on sources
@ 2005-08-31 15:16 Russ Cox
  2005-08-31 21:22 ` arisawa
  0 siblings, 1 reply; 2+ messages in thread
From: Russ Cox @ 2005-08-31 15:16 UTC (permalink / raw)
  To: 9fans

There is already code in utf.c that addresses the
partial rune case.  It was just slightly wrong.

Russ

  		tot += n;
  		for(i=j=0; i<tot; ){
  			c = our_mbtowc(&l, buf+i, tot-i);
- 			if(c == -1)
+ 			if(c == -2)
  				break;
- 			if(c == -2){
+ 			if(c == -1){
  				if(squawk)
  					EPR "%s: bad UTF sequence near byte %ld in input\n", argv0, ninput+i);
  				if(clean)
  					continue;
  				nerrors++;
  				l = Runeerror;
+ 				c = 1;
  			}
  			runes[j++] = l;
  			i += c;


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [9fans] tcs bug fixed on sources
  2005-08-31 15:16 [9fans] tcs bug fixed on sources Russ Cox
@ 2005-08-31 21:22 ` arisawa
  0 siblings, 0 replies; 2+ messages in thread
From: arisawa @ 2005-08-31 21:22 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> There is already code in utf.c that addresses the
> partial rune case.  It was just slightly wrong.
>

thanks russ for your quick response.
I have confirmed your fix works fine.

Kenji Arisawa



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-08-31 21:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-31 15:16 [9fans] tcs bug fixed on sources Russ Cox
2005-08-31 21:22 ` arisawa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).