fileutils.rb: fix error for non-existent entry
* lib/fileutils.rb (FileUtils::Entry_#copy): ensure that the source entry exists first, to fix error for non-existent entry. [ruby-core:77885] [Bug #12892] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
03c9bc2b1d
commit
0785b3e1b7
@ -1,3 +1,9 @@
|
|||||||
|
Fri Nov 4 10:35:47 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/fileutils.rb (FileUtils::Entry_#copy): ensure that the
|
||||||
|
source entry exists first, to fix error for non-existent entry.
|
||||||
|
[ruby-core:77885] [Bug #12892]
|
||||||
|
|
||||||
Thu Nov 3 21:45:00 2016 Kenta Murata <mrkn@mrkn.jp>
|
Thu Nov 3 21:45:00 2016 Kenta Murata <mrkn@mrkn.jp>
|
||||||
|
|
||||||
* ext/bigdecimal/bigdecimal.c: Import changes from ruby/bigdecimal
|
* ext/bigdecimal/bigdecimal.c: Import changes from ruby/bigdecimal
|
||||||
|
@ -1244,6 +1244,7 @@ module FileUtils
|
|||||||
end
|
end
|
||||||
|
|
||||||
def copy(dest)
|
def copy(dest)
|
||||||
|
lstat
|
||||||
case
|
case
|
||||||
when file?
|
when file?
|
||||||
copy_file dest
|
copy_file dest
|
||||||
|
@ -361,6 +361,11 @@ class TestFileUtils < Test::Unit::TestCase
|
|||||||
assert_raise(ArgumentError, bug3588) do
|
assert_raise(ArgumentError, bug3588) do
|
||||||
cp_r 'tmp2', 'tmp2/new_tmp2'
|
cp_r 'tmp2', 'tmp2/new_tmp2'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
bug12892 = '[ruby-core:77885] [Bug #12892]'
|
||||||
|
assert_raise(Errno::ENOENT, bug12892) do
|
||||||
|
cp_r 'non/existent', 'tmp'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_cp_r_symlink
|
def test_cp_r_symlink
|
||||||
|
Loading…
x
Reference in New Issue
Block a user