未验证 提交 bf5f7380 编写于 作者: J jchazalon 提交者: GitHub

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: https://github.com/opencv/opencv_contrib/issues/1131
上级 8edc2e5a
......@@ -34,9 +34,9 @@ file(WRITE "${OPENCV_DOWNLOAD_LOG}" "use_cache \"${OPENCV_DOWNLOAD_PATH}\"\n")
function(ocv_download)
cmake_parse_arguments(DL "UNPACK;RELATIVE_URL" "FILENAME;HASH;DESTINATION_DIR;ID;STATUS" "URL" ${ARGN})
macro(ocv_download_log)
function(ocv_download_log)
file(APPEND "${OPENCV_DOWNLOAD_LOG}" "${ARGN}\n")
endmacro()
endfunction()
ocv_assert(DL_FILENAME)
ocv_assert(DL_HASH)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册