Plan 9 from Bell Labs’s /usr/web/sources/contrib/uriel/changes/2006/0329/4

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


tcs: fix UTF-near-EOF bug and add TUNE encoding
 [rsc] --rw-rw-r-- M 22963 glenda sys 7975 Mar 29 17:57 sys/src/cmd/tcs/utf.c
	/n/sourcesdump/2006/0329/plan9/sys/src/cmd/tcs/utf.c:37,43 - 
	/n/sourcesdump/2006/0330/plan9/sys/src/cmd/tcs/utf.c:37,43
	  	tot = 0;
	  	while((n = read(fd, buf+tot, N-tot)) >= 0){
	  		tot += n;
	- 		for(i=j=0; i<tot; ){
	+ 		for(i=j=0; i<tot-UTFmax || (n==0 && i<tot); ){
	  			c = our_mbtowc(&l, buf+i, tot-i);
	  			if(c == -1){
	  				if(squawk)
	/n/sourcesdump/2006/0329/plan9/sys/src/cmd/tcs/utf.c:61,66 - 
	/n/sourcesdump/2006/0330/plan9/sys/src/cmd/tcs/utf.c:61,67
	  		if(n == 0)
	  			break;
	  	}
	+ 	OUT(out, runes, 0);
	  }
	  
	  void
	/n/sourcesdump/2006/0329/plan9/sys/src/cmd/tcs/utf.c:112,117 - 
	/n/sourcesdump/2006/0330/plan9/sys/src/cmd/tcs/utf.c:113,119
	  		if(n == 0)
	  			break;
	  	}
	+ 	OUT(out, runes, 0);
	  }
	  
	  void


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.