diff options
author | Nobuyoshi Nakada <[email protected]> | 2024-10-02 19:04:48 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2024-10-02 20:43:40 +0900 |
commit | 4e219d8f7d3e76cf60e747dc16deb3452f297442 () | |
tree | d250b0b25f2ec529fc19740a74637e3757c863ad /version.c | |
parent | acbdb309417a8436ae542cc8948121d9baaf1fed (diff) |
Split appending options to ruby_description
It's becoming tedious to map each format specifier to an argument.
Notes: Merged: https://.com/ruby/ruby/pull/11761
-rw-r--r-- | version.c | 22 |
1 files changed, 8 insertions, 14 deletions
@@ -153,20 +153,14 @@ define_ruby_description(const char *const jit_opt) + rb_strlen_lit(" +PRISM") ]; - const char *const threads_opt = ruby_mn_threads_enabled ? " +MN" : ""; - const char *const parser_opt = (*rb_ruby_prism_ptr()) ? " +PRISM" : ""; - - int n = snprintf(desc, sizeof(desc), - "%.*s" - "%s" // jit_opt - "%s" // threads_opts - "%s" // parser_opt - "%s", - ruby_description_opt_point, ruby_description, - jit_opt, - threads_opt, - parser_opt, - ruby_description + ruby_description_opt_point); VALUE description = rb_obj_freeze(rb_usascii_str_new_static(desc, n)); rb_dynamic_description = desc; |