Skip to content

Commit bf5f738

Browse files
authored
Update OpenCVDownload.cmake to fix log crash
This suppresses the interpretation of string literals by switching the ocv_download_log from a macro to a function. This avoid crashes when the string to log contains escape characters. More details about the problem this PR fixes are available at: opencv/opencv_contrib#1131
1 parent 8edc2e5 commit bf5f738

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmake/OpenCVDownload.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ file(WRITE "${OPENCV_DOWNLOAD_LOG}" "use_cache \"${OPENCV_DOWNLOAD_PATH}\"\n")
3434
function(ocv_download)
3535
cmake_parse_arguments(DL "UNPACK;RELATIVE_URL" "FILENAME;HASH;DESTINATION_DIR;ID;STATUS" "URL" ${ARGN})
3636

37-
macro(ocv_download_log)
37+
function(ocv_download_log)
3838
file(APPEND "${OPENCV_DOWNLOAD_LOG}" "${ARGN}\n")
39-
endmacro()
39+
endfunction()
4040

4141
ocv_assert(DL_FILENAME)
4242
ocv_assert(DL_HASH)

0 commit comments

Comments
 (0)