]> git.ipfire.org Git - thirdparty/git.git/commitdiff
cmake: quote the path accurately when editing `test-lib.sh`
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 30 Sep 2020 15:26:19 +0000 (15:26 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 30 Sep 2020 20:25:59 +0000 (13:25 -0700)
By default, the build directory will be called something like
`contrib/buildsystems/out/build/x64-Debug (default)` (note the space and
the parentheses). We need to make sure that such a path is quoted
properly when editing the assignment of the `GIT_BUILD_DIR` variable.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/buildsystems/CMakeLists.txt

index 02241dcc7784f68da54402a665801f74f1382c27..3bb74337e118de291d9fd4f85e59236725eddbb0 100644 (file)
@@ -949,7 +949,7 @@ if(NOT ${CMAKE_BINARY_DIR}/CMakeCache.txt STREQUAL ${CACHE_PATH})
        file(WRITE ${CMAKE_BINARY_DIR}/CTestCustom.cmake
                "file(STRINGS ${CMAKE_SOURCE_DIR}/t/test-lib.sh GIT_BUILD_DIR_REPL REGEX \"GIT_BUILD_DIR=(.*)\")\n"
                "file(STRINGS ${CMAKE_SOURCE_DIR}/t/test-lib.sh content NEWLINE_CONSUME)\n"
-               "string(REPLACE \"\${GIT_BUILD_DIR_REPL}\" \"GIT_BUILD_DIR=\\\"$TEST_DIRECTORY\\\"/../${BUILD_DIR_RELATIVE}\" content \"\${content}\")\n"
+               "string(REPLACE \"\${GIT_BUILD_DIR_REPL}\" \"GIT_BUILD_DIR=\\\"$TEST_DIRECTORY/../${BUILD_DIR_RELATIVE}\\\"\" content \"\${content}\")\n"
                "file(WRITE ${CMAKE_SOURCE_DIR}/t/test-lib.sh \${content})")
        #misc copies
        file(COPY ${CMAKE_SOURCE_DIR}/t/chainlint.sed DESTINATION ${CMAKE_BINARY_DIR}/t/)