diff --git a/string.c b/string.c index 050ef27d9b..e9204fc233 100644 --- a/string.c +++ b/string.c @@ -3077,7 +3077,10 @@ rb_str_prepend_multi(int argc, VALUE *argv, VALUE str) { str_modifiable(str); - if (argc > 0) { + if (argc == 1) { + rb_str_update(str, 0L, 0L, argv[0]); + } + else if (argc > 1) { int i; VALUE arg_str = rb_str_tmp_new(0); rb_enc_copy(arg_str, str);