From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Message-id: <36F38215-C75A-46DD-9287-006878D7A102@mac.com> From: Pietro Gagliardi To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> In-reply-to: <20080710185217.6F0201E8C22@holo.morphisms.net> Date: Thu, 10 Jul 2008 16:18:13 -0400 References: <20080710185217.6F0201E8C22@holo.morphisms.net> Subject: Re: [9fans] Bgetrune while(i>runesize) loop Topicbox-Message-UUID: e27d80d4-ead3-11e9-9d60-3106f5b1d025 I got nothing spectacular from that, but changing the \x00s to QRS gave me something interesting: without the loop, readrune gives me [?]S, but with it it, it gives me [?]QRS, like cat would've. Would this be because fullrune doesn't check for validity, and if chartorune fails then the possibility of eating too much comes about? On Jul 10, 2008, at 2:53 PM, Russ Cox wrote: >> Hello. I was looking at the code for the Bgetrune function trying to >> implement a readrune() around read(). It works, but without a >> counterpart for this: >> >> while(i > bp->runesize) { >> Bungetc(bp); >> i--; >> } >> >> What is the point of that loop? Thanks. > > Use "\xE0\x00\x00" as your input and you will find out. > > Russ > >