ruby-changes:50047
From: nobu <ko1@a...>
Date: Sat, 3 Feb 2018 01:10:21 +0900 (JST)
Subject: [ruby-changes:50047] nobu:r62165 (trunk): process.c: reduce intermediate string
nobu 2018-02-03 01:10:17 +0900 (Sat, 03 Feb 2018) New Revision: 62165 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62165 Log: process.c: reduce intermediate string Modified files: trunk/process.c Index: process.c =================================================================== --- process.c (revision 62164) +++ process.c (revision 62165) @@ -4091,10 +4091,11 @@ rb_f_system(int argc, VALUE *argv) https://github.com/ruby/ruby/blob/trunk/process.c#L4091 status = PST2INT(rb_last_status_get()); if (status == EXIT_SUCCESS) return Qtrue; if (eargp->exception) { - VALUE str = rb_str_buf_new(0); + VALUE str = rb_str_new_cstr("Command failed with"); pst_message(str, (rb_pid_t)-1, status); - rb_raise(rb_eRuntimeError, "Command failed with%"PRIsVALUE": %s", - str, RSTRING_PTR(eargp->invoke.sh.shell_script)); + rb_str_cat_cstr(str, ": "); + rb_str_append(str, eargp->invoke.sh.shell_script); + rb_exc_raise(rb_exc_new_str(rb_eRuntimeError, str)); } else { return Qfalse; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/