mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Fix error with filenames ending with a dot (#3349)
The second negative argument to split instructs it to preserve null fields in the returned array
This commit is contained in:
committed by
Brandon Black
parent
829eea0139
commit
1d2ec4dbc3
@@ -63,7 +63,7 @@ module Linguist
|
||||
#
|
||||
# Returns an Array
|
||||
def extensions
|
||||
_, *segments = name.downcase.split(".")
|
||||
_, *segments = name.downcase.split(".", -1)
|
||||
|
||||
segments.map.with_index do |segment, index|
|
||||
"." + segments[index..-1].join(".")
|
||||
|
||||
Reference in New Issue
Block a user