ruby-changes:47979
From: ko1 <ko1@a...>
Date: Mon, 2 Oct 2017 10:57:32 +0900 (JST)
Subject: [ruby-changes:47979] ko1:r60093 (trunk): use `ra` instead of new variables.
ko1 2017-10-02 10:57:27 +0900 (Mon, 02 Oct 2017) New Revision: 60093 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60093 Log: 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! Modified files: trunk/file.c Index: file.c =================================================================== --- file.c (revision 60092) +++ file.c (revision 60093) @@ -2915,13 +2915,11 @@ rb_file_s_rename(VALUE klass, VALUE from https://github.com/ruby/ruby/blob/trunk/file.c#L2915 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/