mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
1fab5e27c3
commit
a700bcfafa
2 changed files with 8 additions and 5 deletions
|
@ -1,3 +1,9 @@
|
|||
Fri Apr 11 14:48:47 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* file.c (rb_stat): dereference using StringValuePtr().
|
||||
|
||||
* file.c (rb_file_s_stat): use rb_stat(). [ruby-dev:20007]
|
||||
|
||||
Fri Apr 11 10:51:08 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||
|
||||
* lib/benchmark.rb (Benchmark::bm): get rid of warning.
|
||||
|
|
7
file.c
7
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);
|
||||
|
|
Loading…
Add table
Reference in a new issue