use ra
instead of new variables.
* file.c (rb_file_s_rename): `struct rename_args ra` already has members which contain C ptrs. Pointed by MSP-Greg. Thanks! git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d0566062f9
commit
da4f041ea2
8
file.c
8
file.c
@ -2915,13 +2915,11 @@ rb_file_s_rename(VALUE klass, VALUE from, VALUE to)
|
||||
RUBY_UBF_IO, 0) < 0) {
|
||||
int e = errno;
|
||||
#if defined DOSISH
|
||||
const char *src = StringValueCStr(f);
|
||||
const char *dst = StringValueCStr(t);
|
||||
switch (e) {
|
||||
case EEXIST:
|
||||
if (chmod(dst, 0666) == 0 &&
|
||||
unlink(dst) == 0 &&
|
||||
rename(src, dst) == 0)
|
||||
if (chmod(ra.dst, 0666) == 0 &&
|
||||
unlink(ra.dst) == 0 &&
|
||||
rename(ra.src, ra.dst) == 0)
|
||||
return INT2FIX(0);
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user