aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/extend/pathname.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index 6e582c703..3d9fa4c94 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -253,7 +253,12 @@ class Pathname
end
def resolved_path_exists?
- (dirname+readlink).exist?
+ link = readlink
+ rescue ArgumentError
+ # The link target contains NUL bytes
+ false
+ else
+ (dirname+link).exist?
end
# perhaps confusingly, this Pathname object becomes the symlink pointing to