IO's seek, rewind, pos= should discard the char that was previously pushed back 
with 'ungetc'
---------------------------------------------------------------------------------------------

                 Key: JRUBY-2203
                 URL: http://jira.codehaus.org/browse/JRUBY-2203
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.1RC2
         Environment: Latest JRuby 1.1RC2
            Reporter: Vladimir Sizikov
            Assignee: Vladimir Sizikov
             Fix For: JRuby 1.1


Position changing methods should discard a char that was pushed back to the 
stream via ungetc.

This example:
{noformat}
File.open('/tmp/blah1', 'w+') { |f| f.puts "HELLO" }
File.open('/tmp/blah1') do |file|
  file.read(0)
  file.ungetc(100)
  p file.getc

  file.ungetc(100)
  file.pos = 0
  p file.getc

  file.ungetc(100)
  file.rewind
  p file.getc

  file.ungetc(100)
  file.seek(0)
  p file.getc
end
{noformat}

MRI prints:
100
72
72
72

JRuby prints:
100
100
100
100

Fix is coming.


-- 
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