summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index 94a702072c..8abfbb8af6 100644
--- a/eval.c
+++ b/eval.c
@@ -7328,9 +7328,13 @@ search_required(fname, featurep, path)
const char *ext, *ftptr;
int type;
+ if (*(ftptr = RSTRING_PTR(fname)) == '~') {
+ fname = rb_file_expand_path(fname, Qnil);
+ ftptr = RSTRING_PTR(fname);
+ }
*featurep = fname;
*path = 0;
- ext = strrchr(ftptr = RSTRING_PTR(fname), '.');
+ ext = strrchr(ftptr, '.');
if (ext && !strchr(ext, '/')) {
if (strcmp(".rb", ext) == 0) {
if (rb_feature_p(ftptr, ext, Qtrue)) {