diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-02 01:57:27 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-02 01:57:27 +0000 |
commit | da4f041ea2671e25fdc209eb24255f776583f127 (patch) | |
tree | 8d976b9fbe60804f00d2c221af95f66728afe8d5 /file.c | |
parent | d0566062f97e0df9637fd78f5c6eef7f5e57991f (diff) | |
download | ruby-da4f041ea2671e25fdc209eb24255f776583f127.tar.gz |
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
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -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 |