9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Russ Cox <rsc@swtch.com>
To: 9fans <9fans@cse.psu.edu>
Subject: [9fans] tcs bug fixed on sources
Date: Wed, 31 Aug 2005 11:16:52 -0400	[thread overview]
Message-ID: <ee9e417a050831081673eab829@mail.gmail.com> (raw)

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;


             reply	other threads:[~2005-08-31 15:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-31 15:16 Russ Cox [this message]
2005-08-31 21:22 ` arisawa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ee9e417a050831081673eab829@mail.gmail.com \
    --to=rsc@swtch.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).