rubinius/rubinius — pull request #2265 by leocassarani (2013-04-09 19:43:25+00:00)
Title: Make "%u" an alias of "%d" on 1.9

Fix the last remaining failing RubySpec for `String#%` by turning the `%u` format into an alias of `%d`.

In the process of implementing this, I found out that in both 1.8 and 1.9 mode, certain format strings such as `%024.30d` (zero padding + fixed width + precision) were ignoring the precision specifier, producing strings that had fewer padding zeros than on MRI.

This was because the "fast, common case" branch in `IntegerAtom` was being executed even when the format string had a precision, even though the special optimised method that was later invoked only took the width into account. This was fixed by making sure the optimised branch isn't executed when a precision is given.

This pull request also contains a commit adding a RubySpec for the aforementioned behaviour of `%d` (and, consequently, `%u` under 1.9).