StringIO#truncate problem
-------------------------

                 Key: JRUBY-3810
                 URL: http://jira.codehaus.org/browse/JRUBY-3810
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.3
            Reporter: Charles
            Priority: Minor


StringIO#truncate should probably zero out the contents of BytesList greater 
than the new length, as if you resize it later it will have the old data 
instead of nulls.

% jruby -rstringio -e "s = StringIO.new('a' * 10); [0, 10].each { |i| 
s.truncate i }; p s.string"
"aaaaaaaaaa"
% ruby -rstringio -e "s = StringIO.new('a' * 10); [0, 10].each { |i| s.truncate 
i }; p s.string"
"\000\000\000\000\000\000\000\000\000\000"


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