From 798d653c5b9908213a2305470f3895abc937396e Mon Sep 17 00:00:00 2001 From: Eidolon Date: Tue, 14 May 2024 19:32:05 -0500 Subject: [PATCH] Substitute some unsafe chars for revision name This ensures that the build system won't output something like ringracers_rr/master.exe, among other potential issues. --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 71348978b..885b5caac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -174,7 +174,9 @@ if(NOT "${SRB2_GIT_DIR}" STREQUAL "" AND "${SRB2_SDL2_EXE_NAME}" STREQUAL "") list(APPEND EXE_NAME_PARTS "ringracers") if(NOT "${SRB2_GIT_REVISION}" STREQUAL "master") - list(APPEND EXE_NAME_PARTS ${SRB2_GIT_REVISION}) + # substitute path-unsafe characters + string(REGEX REPLACE "[\\\/\^\$]" "_" SAFE_REVISION "${SRB2_GIT_REVISION}") + list(APPEND EXE_NAME_PARTS ${SAFE_REVISION}) endif() if (SRB2_CONFIG_TESTERS)