diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 433caefbb2..69339b448a 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -1594,7 +1594,7 @@ static bool RunCommand(const char* comment, std::vector& command, retCode == 0 || (retCodeOkay && retCodeOkay(retCode)); bool const success = commandResult && retCodeSuccess; if (retCodeOut) { - if (commandResult || !retCodeOkay) { + if (commandResult || !retCodeSuccess) { *retCodeOut = retCode; } else { *retCodeOut = -1;