* fix(cmake): Commit messages may have "quotes" in them, which can affect the const char* variable. (#1840)

This commit is contained in:
Quentin 2023-07-25 14:26:48 +02:00 committed by GitHub
parent cf2ada366c
commit 5ee49c8f4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,6 +23,9 @@ if(Git_FOUND)
OUTPUT_VARIABLE GIT_COMMIT_SUBJECT
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
# Commit messages may have quotes in them, which can affect the const char* variable.
string(REPLACE "\"" "\\\"" GIT_COMMIT_SUBJECT "${GIT_COMMIT_SUBJECT}")
# branch name
execute_process(COMMAND
"${GIT_EXECUTABLE}" branch --show-current