Cleanup, prep for editor
This commit is contained in:
@@ -24,8 +24,8 @@ foreach(line IN LISTS ENV_LINES)
|
||||
continue()
|
||||
endif()
|
||||
|
||||
# Expect KEY=VALUE
|
||||
if(NOT line MATCHES "^[A-Za-z_][A-Za-z0-9_]*=")
|
||||
# Expect KEY=VALUE (allow spaces around '=')
|
||||
if(NOT line MATCHES "^[A-Za-z_][A-Za-z0-9_]*[ \t]*=[ \t]*")
|
||||
message(WARNING "Skipping invalid line in ${ENV_FILE}: '${line}'")
|
||||
continue()
|
||||
endif()
|
||||
@@ -34,9 +34,8 @@ foreach(line IN LISTS ENV_LINES)
|
||||
string(REGEX MATCH "^[A-Za-z_][A-Za-z0-9_]*" KEY "${line}")
|
||||
string(LENGTH "${KEY}" key_len)
|
||||
|
||||
# Extract value
|
||||
string(SUBSTRING "${line}" ${key_len} -1 rest)
|
||||
string(REGEX REPLACE "^[ \t]*=[ \t]*" "" RAW_VALUE "${rest}")
|
||||
# Extract value (allow spaces around '=')
|
||||
string(REGEX REPLACE "^[A-Za-z_][A-Za-z0-9_]*[ \t]*=[ \t]*" "" RAW_VALUE "${line}")
|
||||
|
||||
# Lowercase copy for boolean detection
|
||||
string(TOLOWER "${RAW_VALUE}" VALUE_LC)
|
||||
|
||||
Reference in New Issue
Block a user