[#65451] [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string — ko1@...
Issue #10333 has been updated by Koichi Sasada.
ko1@atdot.net wrote:
Eric Wong <normalperson@yhbt.net> wrote:
Eric Wong <normalperson@yhbt.net> wrote:
On 2014/10/09 11:04, Eric Wong wrote:
SASADA Koichi <ko1@atdot.net> wrote:
[#65453] [ruby-trunk - Feature #10328] [PATCH] make OPT_SUPPORT_JOKE a proper VM option — ko1@...
Issue #10328 has been updated by Koichi Sasada.
[#65559] is there a name for this? — Xavier Noria <fxn@...>
When describing stuff about constants (working in their guide), you often
On 2014/10/09 20:41, Xavier Noria wrote:
On Thu, Oct 9, 2014 at 1:59 PM, Nobuyoshi Nakada <nobu@ruby-lang.org> wrote:
[#65566] [ruby-trunk - Feature #10351] [Open] [PATCH] prevent CVE-2014-6277 — shyouhei@...
Issue #10351 has been reported by Shyouhei Urabe.
[#65741] Re: [ruby-cvs:55121] normal:r47971 (trunk): test/ruby/test_rubyoptions.rb: fix race — Nobuyoshi Nakada <nobu@...>
On 2014/10/16 10:10, normal@ruby-lang.org wrote:
Nobuyoshi Nakada <nobu@ruby-lang.org> wrote:
2014-10-16 12:48 GMT+09:00 Eric Wong <normalperson@yhbt.net>:
[#65753] [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string — ko1@...
Issue #10333 has been updated by Koichi Sasada.
[#65818] [ruby-trunk - Feature #10351] [PATCH] prevent CVE-2014-6277 — shyouhei@...
Issue #10351 has been updated by Shyouhei Urabe.
[ruby-core:66038] [ruby-trunk - Bug #10454] %i doesn't have any special behavior in rb_sprintf et al.
Issue #10454 has been updated by Max Anselm.
Well I can't get it to work for some reason. When I run this code:
~~~
#include <ruby.h>
VALUE func(VALUE arg)
{
VALUE str = rb_sprintf("%i %+i : %d %+d", Qtrue, Qtrue, Qtrue, Qtrue);
rb_funcall(rb_mKernel, rb_intern("puts"), 1, str);
rb_warn("%i %+i : %d %+d", Qtrue, Qtrue, Qtrue, Qtrue);
rb_raise(rb_eRuntimeError, "%i %+i : %d %+d", Qtrue, Qtrue, Qtrue, Qtrue);
}
int main(int argc, char* argv[])
{
ruby_init();
int state;
rb_protect(func, Qnil, &state);
return ruby_cleanup(state);
}
~~~
I get
~~~
20 +20 : 20 +20
<main>: warning: 20 +20 : 20 +20
<main>: 20 +20 : 20 +20 (RuntimeError)
~~~
----------------------------------------
Bug #10454: %i doesn't have any special behavior in rb_sprintf et al.
https://bugs.ruby-lang.org/issues/10454#change-49757
* Author: Max Anselm
* Status: Closed
* Priority: Normal
* Assignee: Zachary Scott
* Category: doc
* Target version:
* ruby -v: ruby 2.1.4p265 (2014-10-27 revision 48166) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
README.EXT claims:
> In the format string, `%i` is used for `Object#to_s` (or `Object#inspect` if ‘+’ flag is set) output (and related argument must be a VALUE).
But if you look at the code, this isn't true. %d and %i are handled the same in `BSD_vfprintf` (which is where all the printf functions end up). Has this ever been the case? I went back to when this documentation was added and it still looks like they're handled the same.
--
https://bugs.ruby-lang.org/