From: "NAKAMURA, Hiroshi" Date: 2009-12-09T22:58:21+09:00 Subject: [ruby-core:27115] Re: [Bug #2449] StringIO#ungetc behavior is contrary to its spec Hi, On Mon, Dec 7, 2009 at 08:02, Yukihiro Matsumoto wrote: > Spec has changed for 1.9: > > �call-seq: > � strio.ungetc(string) � -> nil > > �Pushes back one character (passed as a parameter) onto *strio* > �such that a subsequent buffered read will return it. �There is no > �limitation for multiple pushbacks including pushing back behind the > �beginning of the buffer string. Yes. > 1.8.7 inherits the behavior from 1.9, but spec statement has not been > updated. Do you mean this IO change (multiple pushbacks and behind the beginning) should be backported to 1.8? 0% ruby19 -ve 'r,w = IO.pipe; r.ungetc(?a); p r.getc' ruby 1.9.2dev (2009-12-08 trunk 26049) [i686-linux] "a" 0% ruby -ve 'r,w = IO.pipe; r.ungetc(?a); p r.getc' ruby 1.8.8dev (2009-12-07 revision 25983) [i686-linux] -e:1:in `ungetc': unread stream (IOError) from -e:1 1% // NaHi