diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-04-11 05:49:34 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-04-11 05:49:34 +0000 |
commit | 13b8b9bee70653eeb2384cdfcb9c34e5769b3c41 (patch) | |
tree | 0bece1bf75e40133516d7de9c0e1c5722b526c6f /file.c | |
parent | e1ad97647a930feb458e11e75835b59940fda79c (diff) | |
download | ruby-13b8b9bee70653eeb2384cdfcb9c34e5769b3c41.tar.gz ruby-13b8b9bee70653eeb2384cdfcb9c34e5769b3c41.tar.xz ruby-13b8b9bee70653eeb2384cdfcb9c34e5769b3c41.zip |
* file.c (rb_stat): dereference using StringValuePtr().
* file.c (rb_file_s_stat): use rb_stat(). [ruby-dev:20007]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -354,10 +354,7 @@ rb_stat(file, st) return fstat(fileno(fptr->f), st); } SafeStringValue(file); -#if defined DJGPP - if (RSTRING(file)->len == 0) return -1; -#endif - return stat(RSTRING(file)->ptr, st); + return stat(StringValuePtr(file), st); } static VALUE @@ -367,7 +364,7 @@ rb_file_s_stat(klass, fname) struct stat st; SafeStringValue(fname); - if (stat(RSTRING(fname)->ptr, &st) == -1) { + if (rb_stat(fname, &st) < 0) { rb_sys_fail(RSTRING(fname)->ptr); } return stat_new(&st); |