summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2024-01-01 00:58:22 (GMT)
committerCraig Scott <craig.scott@crascit.com>2024-01-01 00:58:22 (GMT)
commitd0f395525fb4b28af52f5f0d253255e623302bd5 (patch)
tree538bd68f03346833c8f71d0f6a9f89cd718bd73f
parent5a4d7c254ff03a2a814f67cc6f4b2d095522b216 (diff)
downloadCMake-d0f395525fb4b28af52f5f0d253255e623302bd5.zip
CMake-d0f395525fb4b28af52f5f0d253255e623302bd5.tar.gz
CMake-d0f395525fb4b28af52f5f0d253255e623302bd5.tar.bz2
Tests: Quote possibly empty string(REPLACE) argument
The ${unity_source_line} variable should not normally be empty, but it has been observed that it sometimes is due to other factors. Rather than causing string(REPLACE) to fail due to the wrong number of arguments, quote the variable so that the UnityBuildPre2017 test case fails with a more appropriate error in the block just after the usage fixed by this change.
-rw-r--r--Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake b/Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake
index 17e7b46..c904cd0 100644
--- a/Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake
+++ b/Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake
@@ -27,7 +27,7 @@ foreach(line IN LISTS tgt_projects_strings)
endif()
endforeach()
-string(REPLACE "\\" "/" unity_source_line ${unity_source_line})
+string(REPLACE "\\" "/" unity_source_line "${unity_source_line}")
string(FIND "${unity_source_line}" "CMakeFiles/tgt.dir/Unity/unity_0_c.c" unity_source_file_position)
if (unity_source_file_position EQUAL "-1")
set(RunCMake_TEST_FAILED "Generated project should include the generated unity source file.")