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.
This commit is contained in:
Tim D. Smith 2016-03-15 23:40:59 -07:00 committed by Xu Cheng
parent 4516375db4
commit f30c264519

View File

@ -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