aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/os/mac/xquartz.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/Library/Homebrew/os/mac/xquartz.rb b/Library/Homebrew/os/mac/xquartz.rb
index ed7473cef..b1bd45d2c 100644
--- a/Library/Homebrew/os/mac/xquartz.rb
+++ b/Library/Homebrew/os/mac/xquartz.rb
@@ -11,8 +11,8 @@ module MacOS::XQuartz extend self
end
def detect_version
- if (path = bundle_path) && path.exist?
- version_from_mdls(path)
+ if (path = bundle_path) && path.exist? && (version = version_from_mdls(path))
+ version
elsif prefix.to_s == "/usr/X11"
guess_system_version
else
@@ -29,7 +29,8 @@ module MacOS::XQuartz extend self
end
def version_from_mdls(path)
- `mdls -raw -name kMDItemVersion "#{path}" 2>/dev/null`.strip
+ version = `mdls -raw -nullMarker "" -name kMDItemVersion "#{path}" 2>/dev/null`.strip
+ version unless version.empty?
end
# The XQuartz that Apple shipped in OS X through 10.7 does not have a