lib/assembly-objectfile/object_file.rb in assembly-objectfile-1.10.0 vs lib/assembly-objectfile/object_file.rb in assembly-objectfile-1.10.1
- old
+ new
@@ -17,13 +17,13 @@
n = 0
x = strings.last
n += 1 while strings.all? { |s| s[n] && (s[n] == x[n]) }
common_prefix = x[0...n]
- if common_prefix[-1, 1] != '/' # check if last element of the common string is the end of a directory
- common_prefix.split('/')[0..-2].join('/') + '/' # if not, split string along directories, and reject last one
+ if common_prefix[-1, 1] == '/' # check if last element of the common string is the end of a directory
+ common_prefix # if not, split string along directories, and reject last one
else
- common_prefix # if it was, then return the common prefix directly
+ "#{common_prefix.split('/')[0..-2].join('/')}/" # if it was, then return the common prefix directly
end
end
end
end