diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-02 16:10:17 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-02 16:10:17 +0000 |
commit | 228bffe5e12cc3cbe9daeeff0bb1a95d89315bff (patch) | |
tree | 8166f8491b5705eb81c3f38b4a7cfc19a33d381c /process.c | |
parent | 4c577c4a4565bb614608e0f626ed07e821e0423f (diff) | |
download | ruby-228bffe5e12cc3cbe9daeeff0bb1a95d89315bff.tar.gz |
process.c: reduce intermediate string
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r-- | process.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -4091,10 +4091,11 @@ rb_f_system(int argc, VALUE *argv) 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; |