summaryrefslogtreecommitdiff
path: root/ext/pathname/lib
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pathname/lib')
-rw-r--r--ext/pathname/lib/pathname.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb
index e61aa2c081..82541e9b15 100644
--- a/ext/pathname/lib/pathname.rb
+++ b/ext/pathname/lib/pathname.rb
@@ -22,7 +22,8 @@ class Pathname
end
SAME_PATHS = if File::FNM_SYSCASE.nonzero?
- proc {|a, b| a.casecmp(b).zero?}
+ # Avoid #zero? here because #casecmp can return nil.
+ proc {|a, b| a.casecmp(b) == 0}
else
proc {|a, b| a == b}
end