summaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-07-26 03:54:48 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-07-26 03:54:48 +0000
commit582c7f85df7ade3bcce8377553b2db44db3dc8e2 (patch)
treecdb53896415e76e095ec84bb2eb9d90f57cf778a /file.c
parent1e0a8b019dd1f1a09b3cd5d56133bee2e359226f (diff)
downloadruby-582c7f85df7ade3bcce8377553b2db44db3dc8e2.tar.gz
ruby-582c7f85df7ade3bcce8377553b2db44db3dc8e2.tar.xz
ruby-582c7f85df7ade3bcce8377553b2db44db3dc8e2.zip
* file.c (rb_find_file_noext, rb_find_file): fix tilde expansion
problem. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/file.c b/file.c
index e7271defe..cf1dcc470 100644
--- a/file.c
+++ b/file.c
@@ -2278,6 +2278,8 @@ rb_find_file_noext(filep)
if (rb_safe_level() >= 2 && OBJ_TAINTED(fname)) {
rb_raise(rb_eSecurityError, "loading from unsafe file %s", f);
}
+ f = STR2CSTR(fname);
+ *filep = fname;
}
if (is_absolute_path(f)) {
@@ -2323,10 +2325,11 @@ rb_find_file(path)
struct stat st;
if (f[0] == '~') {
- tmp = rb_file_s_expand_path(1, &path);
- if (rb_safe_level() >= 2 && OBJ_TAINTED(tmp)) {
+ path = rb_file_s_expand_path(1, &path);
+ if (rb_safe_level() >= 2 && OBJ_TAINTED(path)) {
rb_raise(rb_eSecurityError, "loading from unsafe file %s", f);
}
+ f = STR2CSTR(path);
}
#if defined(__MACOS__) || defined(riscos)