Commit 535da775 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

cmd: Don't crash on 'if exist' without parameter.

parent 488a00c3
......@@ -2811,8 +2811,9 @@ int evaluate_if_condition(WCHAR *p, WCHAR **command, int *test, int *negate)
WCHAR *param = WCMD_parameter(p, 1+(*negate), NULL, FALSE, FALSE);
int len = lstrlenW(param);
if (!len) goto syntax_err;
/* FindFirstFile does not like a directory path ending in '\', append a '.' */
if (len && param[len-1] == '\\') lstrcatW(param, L".");
if (param[len-1] == '\\') lstrcatW(param, L".");
hff = FindFirstFileW(param, &fd);
*test = (hff != INVALID_HANDLE_VALUE );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment