rb_add_suffix in util.c is GPL and obsoleted code, so I want to remove it.
rb_add_suffix is drived from Perl's win32.c file and GPL/Artistic License.
The code is used when ruby runs with -i (inplace option).
Practically it works only when the renamed file can't create.
(the validation is also a function of the code, but it is not essential)
But this behavior is Windows specific.
On other environment, ruby simply skip the file with a warning "Can't rename %s to %s: %s, skipping file".
I think Windows should follow this.
Updated by usa (Usaku NAKAMURA) almost 9 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r32826.
Yui, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
util.c, include/ruby/util.h (ruby_add_suffix): remove the function.
[Bug #5153] [ruby-core:38736]
io.c (argf_next_argv): remove the call of above function.
ext/-test-/add_suffix, test/-ext-/test_add_suffix.rb: remove the test
extension module because this is only for testsing ruby_add_suffix().
LEGAL: remove the mention about a part of util.c, because now we
removed the part.
io.c (argf_next_argv): now the new filename is not guranteed to
use, so should check the return value of rename(2).
now we expect same result with other platforms on no_safe_rename