diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c index 57a41c47523..ff58484b9ad 100644 --- a/programs/cmd/builtins.c +++ b/programs/cmd/builtins.c @@ -2844,7 +2844,7 @@ void WCMD_if (WCHAR *p, CMD_LIST **cmdList) WIN32_FIND_DATAW fd; HANDLE hff = FindFirstFileW(WCMD_parameter(p, 1+negate, NULL, FALSE, FALSE), &fd); test = (hff != INVALID_HANDLE_VALUE ); - if (!test) FindClose(hff); + if (test) FindClose(hff); WCMD_parameter(p, 2+negate, &command, FALSE, FALSE); }