String#unpack with "m" pattern is incorrect
-------------------------------------------
Key: JRUBY-1834
URL: http://jira.codehaus.org/browse/JRUBY-1834
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.x
Environment: Latest JRuby 1.1b1
Reporter: Vladimir Sizikov
Attachments: string-unpack-m.patch
Consider the following examples:
{noformat}
"ab c=awerB2y+".unpack('mmmmm')
"a=b=c=d=e=f=g=".unpack('mamamamam')
{noformat}
MRI returns:
{noformat}
["i\267", "k\a\253\al\276", "", "", ""]
["i", "=", "q", "=", "y", "=", "", "", ""]
{noformat}
JRuby returns:
{noformat}
["i", "", "k\a\253\al\276", "", ""]
["", "b", "", "c", "", "d", "", "e", ""]
{noformat}
This leads to rubinius spec failure.
The proposed patch fixes the problem (the implementation is closely following
MRI).
After the patch, all spec tests pass.
--
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