Explorar o código

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.
Brad King %!s(int64=11) %!d(string=hai) anos
pai
achega
e177e7affb
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      Modules/FindPackageHandleStandardArgs.cmake

+ 1 - 1
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()