From ea11f814fa47186d493103941343a01ff7cd4f06 Mon Sep 17 00:00:00 2001 From: vitaut Date: Mon, 28 Mar 2016 17:22:25 -0700 Subject: [PATCH] Fix handling of backslash-newline sequences in environment variables --- support/cmake/init.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/support/cmake/init.cmake b/support/cmake/init.cmake index 7dc59a77e..5a5a68430 100644 --- a/support/cmake/init.cmake +++ b/support/cmake/init.cmake @@ -72,9 +72,9 @@ if (MP_WINSDK) execute_process(COMMAND ${run_setenv} "${MP_SETENV}" "${setenv_arg}" OUTPUT_VARIABLE out ERROR_VARIABLE err) string(REPLACE ";" "\;" out "${out}") - string(REGEX MATCHALL "[^\n]+" out "${out}") + string(REGEX MATCHALL "[^\n]+\n" out "${out}") foreach (env ${out}) - if (env MATCHES "([^=]+)=(.*)") + if (env MATCHES "([^=]+)=(.*)\n") set(ENV{${CMAKE_MATCH_1}} "${CMAKE_MATCH_2}") endif () endforeach ()