Skip to content

Commit

Permalink
Address feedback on using regex
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomsonTan committed Dec 8, 2023
1 parent f54be88 commit 8821bf8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cmake/opentelemetry-build-external-component.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

function(get_directory_name_in_path PATH_VAR RESULT_VAR)
# get_filename_component does not work with paths ending in / or \, so remove it.
string(REGEX REPLACE "/$" "" PATH_TRIMMED "${PATH_VAR}")
string(REGEX REPLACE "\\$" "" PATH_TRIMMED "${PATH_VAR}")
string(REGEX REPLACE "[/\\]$" "" PATH_TRIMMED "${PATH_VAR}")

get_filename_component(DIR_NAME ${PATH_TRIMMED} NAME)

Expand Down

0 comments on commit 8821bf8

Please sign in to comment.