diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-01-12 16:26:05 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-01-12 16:26:05 +0000 |
commit | 6c862db688a8a0152630f4fda7930298412f5d21 (patch) | |
tree | f74eab9a0eff6ca9d91977c8ab1d1fbeda36381d | |
parent | c8b7862e86cf4a5e940689071c46a80960daa215 (diff) | |
download | ruby-6c862db688a8a0152630f4fda7930298412f5d21.tar.gz |
* file.c (test_wr): Rdoc fix. [ruby-core:02225]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | file.c | 28 |
2 files changed, 15 insertions, 17 deletions
@@ -1,3 +1,7 @@ +Tue Jan 13 01:24:17 2004 Yukihiro Matsumoto <matz@ruby-lang.org> + + * file.c (test_wr): Rdoc fix. [ruby-core:02225] + Tue Jan 13 01:04:37 2004 Dave Thomas <dave@pragprog.com> * lib/rdoc/ri/ri_paths.rb (RI::Paths): First attempt at @@ -1015,6 +1015,14 @@ test_R(obj, fname) return Qtrue; } +#ifndef S_IRUGO +# define S_IRUGO (S_IRUSR | S_IRGRP | S_IROTH) +#endif + +#ifndef S_IWUGO +# define S_IWUGO (S_IWUSR | S_IWGRP | S_IWOTH) +#endif + /* * call-seq: * File.world_readable?(file_name) => fixnum or nil @@ -1029,14 +1037,6 @@ test_R(obj, fname) * sprintf("%o", m) # => "644" */ -#ifndef S_IRUGO -# define S_IRUGO (S_IRUSR | S_IRGRP | S_IROTH) -#endif - -#ifndef S_IWUGO -# define S_IWUGO (S_IWUSR | S_IWGRP | S_IWOTH) -#endif - static VALUE test_wr(obj, fname) VALUE obj, fname; @@ -1044,7 +1044,7 @@ test_wr(obj, fname) #ifdef S_IROTH struct stat st; - if (rb_stat(fname, &st) < 0) return Qfalse; + if (rb_stat(fname, &st) < 0) return Qnil; if ((st.st_mode & (S_IROTH)) == S_IROTH) { #ifdef __BORLANDC__ return UINT2NUM((unsigned short)(st.st_mode & @@ -1053,11 +1053,8 @@ test_wr(obj, fname) return UINT2NUM(st.st_mode & (S_IRUGO|S_IWUGO|S_IXUGO)); #endif } - else { - return Qnil; - } #endif - return Qfalse; + return Qnil; } /* @@ -1124,11 +1121,8 @@ test_ww(obj, fname) return UINT2NUM(st.st_mode & (S_IRUGO|S_IWUGO|S_IXUGO)); #endif } - else { - return Qnil; - } #endif - return Qfalse; + return Qnil; } /* |