From e177e7affb10fc25b71d4c9d9796c9df7fcdb800 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 8 Sep 2014 11:20:27 -0400 Subject: [PATCH] FPHSA: Avoid if() dereferencing of quoted variable Legacy invocations may pass a variable name where "DEFAULT_MSG" belongs. When comparing FPHSA_FAIL_MESSAGE to "DEFAULT_MSG", use a leading "x" on both sides to avoid mistaking the value of the message for a variable name. --- Modules/FindPackageHandleStandardArgs.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake index d03041852d..e8d1dfb905 100644 --- a/Modules/FindPackageHandleStandardArgs.cmake +++ b/Modules/FindPackageHandleStandardArgs.cmake @@ -201,7 +201,7 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) # now that we collected all arguments, process them - if("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG") + if("x${FPHSA_FAIL_MESSAGE}" STREQUAL "xDEFAULT_MSG") set(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}") endif()