diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-01-09 08:04:39 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-01-09 08:04:39 +0000 |
commit | 42eb597c64770e8108508557645526928a0f0b49 (patch) | |
tree | 34f4111bdc336d84b0f5ab00c8a6b0fb97b5f2a0 /file.c | |
parent | e91fadb105a426803577e81cbcf45f03898495c0 (diff) |
* file.c (path_check_1): should restore modified path.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -2029,6 +2029,7 @@ path_check_1(path) } for (;;) { if (stat(path, &st) == 0 && (st.st_mode & 002)) { + if (p) *p = '/'; return 0; } s = strrchr(path, '/'); @@ -2056,7 +2057,10 @@ rb_path_check(path) if (pend) *pend = '\0'; safe = path_check_1(p); - if (!safe) return 0; + if (!safe) { + if (pend) *pend = sep; + return 0; + } if (!pend) break; *pend = sep; p = pend + 1; |