String#unpack: @ directive doesn't work on substrings
-----------------------------------------------------

                 Key: JRUBY-5733
                 URL: http://jira.codehaus.org/browse/JRUBY-5733
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.6.1
            Reporter: Matt Woenker
            Priority: Minor
         Attachments: fix_unpack_at_on_substring.diff

In String#unpack, the @ directive does not appear to correctly deal with 
strings that have been created as a substring of a larger string. It indexes 
from the beginning of the underlying byte array, even if the string only 
references a subrange.

I've attached a short patch with a two line modification that seems to fix the 
problem, as well as a small addition to test/test_pack.rb. I've never worked on 
the JRuby code so maybe someone with more experience could tell me if this 
looks sane.

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