summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/pathname/lib/pathname.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb
index a6621565d09..8bdb73f439a 100644
--- a/ext/pathname/lib/pathname.rb
+++ b/ext/pathname/lib/pathname.rb
@@ -378,7 +378,7 @@ class Pathname
basename_list2.shift
end
r1 = chop_basename(prefix1)
- if !r1 && /#{SEPARATOR_PAT}/o =~ File.basename(prefix1)
+ if !r1 && (r1 = /#{SEPARATOR_PAT}/o =~ File.basename(prefix1))
while !basename_list2.empty? && basename_list2.first == '..'
index_list2.shift
basename_list2.shift