diff --git a/lib/macho/macho_file.rb b/lib/macho/macho_file.rb index 637907650..89ed23c96 100644 --- a/lib/macho/macho_file.rb +++ b/lib/macho/macho_file.rb @@ -381,11 +381,9 @@ def rpaths # rpaths simultaneously. # @return [void] # @raise [RpathUnknownError] if no such old runtime path exists - # @raise [RpathExistsError] if the new runtime path already exists def change_rpath(old_path, new_path, options = {}) old_lc = command(:LC_RPATH).find { |r| r.path.to_s == old_path } raise RpathUnknownError, old_path if old_lc.nil? - raise RpathExistsError, new_path if rpaths.include?(new_path) new_lc = LoadCommands::LoadCommand.create(:LC_RPATH, new_path) diff --git a/test/test_macho.rb b/test/test_macho.rb index c090b5a1f..b6579f18d 100644 --- a/test/test_macho.rb +++ b/test/test_macho.rb @@ -574,10 +574,6 @@ def test_rpath_exceptions file.change_rpath("/this/rpath/doesn't/exist", "/lib") end - assert_raises MachO::RpathExistsError do - file.change_rpath(file.rpaths.first, file.rpaths.first) - end - assert_raises MachO::RpathExistsError do file.add_rpath(file.rpaths.first) end