On Fri, 2013-03-15 at 17:20 -0400, Mark H Weaver wrote: > Nala Ginrut <nalagin...@gmail.com> writes: > > > On Thu, 2013-03-14 at 17:30 +0800, Nala Ginrut wrote: > >> Attached the patch to fix get-bytevector-all. > >> You may check it like this: > >> (get-bytevector-all (current-input-port)) > >> > >> And try to input then type ctrl+d, the current implementation needs you > >> type ctrl+d twice. > >> > >> Regards. > > > > > > Sorry, but I realized that this patch only fixed when you type ctrl+d in > > the beginning. But if you input something, the problem is still there. > > I'll look deeper. > > FWIW, I suspect you'll have to dig fairly deep to fix this properly. > AFAIK, the ports code was not designed to ensure that exactly one EOF is > reported to the user for each EOF returned by the kernel. I hope to > look into this soon (possibly before 2.0.8), as part of my investigation > of <http://bugs.gnu.org/12216>. >
Yes, I tried the bug-demo code of dwheeler, and found that EOF seems was eaten in somewhere. I read the code on the calling-tree of scm_peek_char, but hardly find the problem related. Maybe it's something about the 'port' implementation? > Thanks, > Mark