From f30c264519afd98b5aac8dd5c48810c761983124 Mon Sep 17 00:00:00 2001 From: "Tim D. Smith" Date: Tue, 15 Mar 2016 23:40:59 -0700 Subject: [PATCH] Avoid pathological trailing slash Resolves an issue where xcode-select output with a terminal slash leads to superenv failing to strip system library paths from ccld-style invocations. Fixes Homebrew/homebrew#49731. Discussion in Homebrew/homebrew#50154. --- Library/Homebrew/os/mac/xcode.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb index 4980fde3d5..b8643aa6d5 100644 --- a/Library/Homebrew/os/mac/xcode.rb +++ b/Library/Homebrew/os/mac/xcode.rb @@ -43,7 +43,8 @@ module OS path = bundle_path path.join("Contents", "Developer") if path else - Pathname.new(dir) + # Use cleanpath to avoid pathological trailing slash + Pathname.new(dir).cleanpath end end end