StringIO::ungetc can't handle the ";" character correctly.
----------------------------------------------------------

                 Key: JRUBY-5455
                 URL: http://jira.codehaus.org/browse/JRUBY-5455
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules, Ruby 1.9
    Affects Versions: JRuby 1.6RC1
         Environment: $ uname -a
Darwin MacBook-Pro.local 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 
18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386 i386
$ jruby --version
jruby 1.6.0.RC1 (ruby 1.9.2 trunk 136) (2011-01-10 769f847) (Java HotSpot(TM) 
64-Bit Server VM 1.6.0_22) [darwin-x86_64-java]

            Reporter: Kiyoka Nishiyama
         Attachments: t3.rb

I found this issue with this source code.

{code:title=t3.rb|borderStyle=solid}
# -*- coding: utf-8 -*-

require 'stringio'

def ungetc_test( )
  f = StringIO.open(";\n", "r:utf-8")
  ch  = f.getc
  printf( "first   : [%s]\n", ch )
  f.ungetc( ch )
  ch2 = f.getc
  printf( "second  : [%s]\n", ch2 )
end

ungetc_test( )
{code}

{code:title=result of JRuby 1.6.0 RC1}
$ jruby t3.rb
first   : [59]
second  : [59]
{code}

{code:title=result of CRuby 1.9.2p136}
ruby t3.rb
first   : [;]
second  : [;]
{code}


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to