Fix language detection for files with dot in their names
This commit is contained in:
@ -24,7 +24,9 @@
|
||||
|
||||
# Helper function to get the language of a source file.
|
||||
function (sanitizer_lang_of_source FILE RETURN_VAR)
|
||||
get_filename_component(FILE_EXT "${FILE}" EXT)
|
||||
get_filename_component(LONGEST_EXT "${FILE}" EXT)
|
||||
# Get shortest extension as some files can have dot in their names
|
||||
string(REGEX REPLACE "^.*(\\.[^.]+)$" "\\1" FILE_EXT ${LONGEST_EXT})
|
||||
string(TOLOWER "${FILE_EXT}" FILE_EXT)
|
||||
string(SUBSTRING "${FILE_EXT}" 1 -1 FILE_EXT)
|
||||
|
||||
|
Reference in New Issue
Block a user