mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 12:19:49 +00:00
Make 'exist' in wcmd handle both file and directories.
This commit is contained in:
parent
5e161ac72a
commit
c79342a11a
1 changed files with 2 additions and 6 deletions
|
@ -384,7 +384,6 @@ char string[MAX_PATH];
|
|||
|
||||
void WCMD_if (char *p) {
|
||||
|
||||
HANDLE h;
|
||||
int negate = 0, test = 0;
|
||||
char condition[MAX_PATH], *command, *s;
|
||||
|
||||
|
@ -401,10 +400,7 @@ char condition[MAX_PATH], *command, *s;
|
|||
WCMD_parameter (p, 2+negate, &command);
|
||||
}
|
||||
else if (!lstrcmpi (condition, "exist")) {
|
||||
if ((h = CreateFile (WCMD_parameter (p, 1+negate, NULL), GENERIC_READ,
|
||||
FILE_SHARE_READ|FILE_SHARE_WRITE, NULL,
|
||||
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) != INVALID_HANDLE_VALUE) {
|
||||
CloseHandle (h);
|
||||
if (GetFileAttributesA(WCMD_parameter (p, 1+negate, NULL)) != INVALID_FILE_ATTRIBUTES) {
|
||||
test = 1;
|
||||
}
|
||||
WCMD_parameter (p, 2+negate, &command);
|
||||
|
|
Loading…
Reference in a new issue