From bf5f7380cff389033e03700960f86fdcea52b390 Mon Sep 17 00:00:00 2001 From: jchazalon Date: Wed, 7 Mar 2018 15:35:37 +0100 Subject: [PATCH] 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 --- cmake/OpenCVDownload.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/OpenCVDownload.cmake b/cmake/OpenCVDownload.cmake index f660502d76..7724147d31 100644 --- a/cmake/OpenCVDownload.cmake +++ b/cmake/OpenCVDownload.cmake @@ -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) -- GitLab