From 2c119911a3cfc7ca3357d3c5ff079cb3f7e464c8 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 66a52fe5e..1f852c981 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -175,7 +175,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)