From 5ee49c8f4f9796a19c47b3a4fda9d8e3ed6d6e03 Mon Sep 17 00:00:00 2001 From: Quentin Date: Tue, 25 Jul 2023 14:26:48 +0200 Subject: [PATCH] * fix(cmake): Commit messages may have "quotes" in them, which can affect the const char* variable. (#1840) --- scripts/git.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/git.cmake b/scripts/git.cmake index 4b9d674a..cc02c0d9 100644 --- a/scripts/git.cmake +++ b/scripts/git.cmake @@ -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