From 42eb597c64770e8108508557645526928a0f0b49 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 9 Jan 2001 08:04:39 +0000 Subject: * 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 --- ChangeLog | 4 ++++ file.c | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 29c5f13eca..fb49f5a76b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Jan 8 21:35:10 2001 Guy Decoux + + * file.c (path_check_1): should restore modified path. + Sat Jan 6 00:55:59 2001 Yukihiro Matsumoto * pack.c (pack_pack): template "m2" or "u2" caused inifinite loop. diff --git a/file.c b/file.c index 98098f9047..db200c6f7e 100644 --- a/file.c +++ b/file.c @@ -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; -- cgit v1.2.3