summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-08 06:30:35 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-08 06:30:35 +0000
commit6e37bdc69f2d910432d20d5e29b8c8268aa06eb4 (patch)
tree7bd0c561a42b4e4d9c64fee779c9a9eacb3bfbe1 /eval.c
parent1bb0917fa78b151729f8e40a98635ffd1ae72e09 (diff)
merge revision(s) 27398:
* eval.c (search_required): expand home relative path first. [ruby-core:29610] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@28210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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)) {