From 264bb210c19fcb3b8b7fc2ce1da579e4842c2715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Csaba=20Osztrogon=C3=A1c?= Date: Fri, 26 Jun 2020 13:46:08 +0200 Subject: [PATCH] Fix profile file parsing in CMake (#3932) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes: - Comment can be started anywhere, not only at the beginning of the input. - The end of the comment isn't the end of the input, but the first newline. JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu --- jerry-core/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jerry-core/CMakeLists.txt b/jerry-core/CMakeLists.txt index 066c6f749..91471ad6f 100644 --- a/jerry-core/CMakeLists.txt +++ b/jerry-core/CMakeLists.txt @@ -264,8 +264,8 @@ endif() if(EXISTS ${JERRY_PROFILE}) file(READ "${JERRY_PROFILE}" PROFILE_SETTINGS) - string(REGEX REPLACE "^#.*$" "" PROFILE_SETTINGS "${PROFILE_SETTINGS}") - string(REGEX REPLACE "[\r|\n]" ";" PROFILE_SETTINGS "${PROFILE_SETTINGS}") + string(REGEX REPLACE "[ \t]*#[^\n]*" "" PROFILE_SETTINGS "${PROFILE_SETTINGS}") + string(REGEX REPLACE "[\r\n]" ";" PROFILE_SETTINGS "${PROFILE_SETTINGS}") # Process entries and save them as CMake variables. # This is required to correctly generate the jerryscript-config.h file.