* file.c (rb_file_world_writable_p): should return nil for non
world-writable files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
89f1118329
commit
c5ce3ea019
@ -1,3 +1,8 @@
|
|||||||
|
Sat Nov 22 18:24:24 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* file.c (rb_file_world_writable_p): should return nil for non
|
||||||
|
world-writable files.
|
||||||
|
|
||||||
Sat Nov 22 10:31:25 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
Sat Nov 22 10:31:25 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
||||||
|
|
||||||
* ext/tk/lib/tkextlib/blt.rb, ext/tk/lib/tkextlib/blt/vector.rb:
|
* ext/tk/lib/tkextlib/blt.rb, ext/tk/lib/tkextlib/blt/vector.rb:
|
||||||
|
2
file.c
2
file.c
@ -1299,7 +1299,7 @@ rb_file_world_writable_p(VALUE obj, VALUE fname)
|
|||||||
#ifdef S_IWOTH
|
#ifdef S_IWOTH
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
if (rb_stat(fname, &st) < 0) return Qfalse;
|
if (rb_stat(fname, &st) < 0) return Qnil;
|
||||||
if ((st.st_mode & (S_IWOTH)) == S_IWOTH) {
|
if ((st.st_mode & (S_IWOTH)) == S_IWOTH) {
|
||||||
return UINT2NUM(st.st_mode & (S_IRUGO|S_IWUGO|S_IXUGO));
|
return UINT2NUM(st.st_mode & (S_IRUGO|S_IWUGO|S_IXUGO));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user