summaryrefslogtreecommitdiff
path: root/load.c
diff options
context:
space:
mode:
Diffstat (limited to 'load.c')
-rw-r--r--load.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/load.c b/load.c
index 891eae48ee..c956977527 100644
--- a/load.c
+++ b/load.c
@@ -551,8 +551,9 @@ search_required(VALUE fname, volatile VALUE *path, int safe_level)
static void
load_failed(VALUE fname)
{
- rb_raise(rb_eLoadError, "cannot load such file -- %s",
- RSTRING_PTR(fname));
+ VALUE mesg = rb_str_buf_new_cstr("cannot load such file -- ");
+ rb_str_append(mesg, fname); /* should be ASCII compatible */
+ rb_exc_raise(rb_exc_new3(rb_eLoadError, mesg));
}
static VALUE