diff options
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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)) { |