cmd.exe: Add "if defined ..." support.

This commit is contained in:
Jason Edmeades 2007-02-20 17:47:35 +00:00 committed by Alexandre Julliard
parent 953940aada
commit 758a397755
1 changed files with 6 additions and 0 deletions

6
programs/cmd/builtins.c Normal file → Executable file
View File

@ -472,6 +472,12 @@ char condition[MAX_PATH], *command, *s;
}
WCMD_parameter (p, 2+negate, &command);
}
else if (!lstrcmpi (condition, "defined")) {
if (GetEnvironmentVariableA(WCMD_parameter (p, 1+negate, NULL), NULL, 0) > 0) {
test = 1;
}
WCMD_parameter (p, 2+negate, &command);
}
else if ((s = strstr (p, "=="))) {
s += 2;
if (!lstrcmpi (condition, WCMD_parameter (s, 0, NULL))) test = 1;