diff --git a/Library/Homebrew/keg_fix_install_names.rb b/Library/Homebrew/keg_fix_install_names.rb index e60ba72f1a..2d79e91807 100644 --- a/Library/Homebrew/keg_fix_install_names.rb +++ b/Library/Homebrew/keg_fix_install_names.rb @@ -64,6 +64,7 @@ class Keg # some_variable="/opt/homebrew/Cellar/foo/1.0/lib" # and add quotes to protect against paths containing spaces. def replace_pkgconfig_file_path(s, old, new) + return if old == new s.gsub!(%r[([\S]+)="?#{Regexp.escape(old)}(.*?)"?$], "\\1=\"#{new}\\2\"") end