ruby-changes:14169
From: nahi <ko1@a...>
Date: Fri, 4 Dec 2009 13:14:53 +0900 (JST)
Subject: [ruby-changes:14169] Ruby:r25987 (trunk): * ext/stringio/stringio.c (ungetc): RDoc updated. trunk allows
nahi 2009-12-04 13:14:37 +0900 (Fri, 04 Dec 2009) New Revision: 25987 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25987 Log: * ext/stringio/stringio.c (ungetc): RDoc updated. trunk allows pushing back behind the beginning of the pseudo stream. Modified files: trunk/ChangeLog trunk/ext/stringio/stringio.c trunk/test/stringio/test_stringio.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 25986) +++ ChangeLog (revision 25987) @@ -1,3 +1,8 @@ +Fri Dec 4 13:10:23 2009 NAKAMURA, Hiroshi <nahi@r...> + + * ext/stringio/stringio.c (ungetc): RDoc updated. trunk allows + pushing back behind the beginning of the pseudo stream. + Fri Dec 4 03:10:38 2009 Shugo Maeda <shugo@r...> * compile.c (compile_cpath, iseq_compile_each): reverted Index: ext/stringio/stringio.c =================================================================== --- ext/stringio/stringio.c (revision 25986) +++ ext/stringio/stringio.c (revision 25987) @@ -696,10 +696,9 @@ * strio.ungetc(string) -> nil * * Pushes back one character (passed as a parameter) onto *strio* - * such that a subsequent buffered read will return it. Pushing back - * behind the beginning of the buffer string is not possible. Nothing - * will be done if such an attempt is made. - * In other case, there is no limitation for multiple pushbacks. + * 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. */ static VALUE strio_ungetc(VALUE self, VALUE c) Index: test/stringio/test_stringio.rb =================================================================== --- test/stringio/test_stringio.rb (revision 25986) +++ test/stringio/test_stringio.rb (revision 25987) @@ -327,7 +327,7 @@ s = "1234" f = StringIO.new(s, "r") assert_nothing_raised { f.ungetc("x") } - assert_equal("x", f.getc) # bug? + assert_equal("x", f.getc) # bug? -> it's a feature from 1.9. assert_equal("1", f.getc) s = "1234" -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/