diff options
author | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-07-26 03:54:48 +0000 |
---|---|---|
committer | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-07-26 03:54:48 +0000 |
commit | 06b7e6a29406963fcfe8307b88f3df30d1de94f9 (patch) | |
tree | e86698f8e060da61a63d9f0226de4a4d0973714a /file.c | |
parent | ae1be89d0fc6b4bd6127ce5e4919106a17b17db6 (diff) |
* file.c (rb_find_file_noext, rb_find_file): fix tilde expansion
problem.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -2177,6 +2177,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)) { @@ -2222,10 +2224,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) |