summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-04-11 05:49:34 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-04-11 05:49:34 +0000
commita700bcfafa78cc719cc5e758cbbd20076bee6adb (patch)
tree0bece1bf75e40133516d7de9c0e1c5722b526c6f /file.c
parent1fab5e27c3dfe4d229510d27b2562f5aa904558c (diff)
* file.c (rb_stat): dereference using StringValuePtr().
* file.c (rb_file_s_stat): use rb_stat(). [ruby-dev:20007] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/file.c b/file.c
index b574711..bd793c5 100644
--- a/file.c
+++ b/file.c
@@ -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);