mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 14:53:40 +00:00
Make IF EXIST directory\ (with trailing backslash) work
svn path=/trunk/; revision=41942
This commit is contained in:
parent
234f0e77c4
commit
1c0bdb07e1
1 changed files with 12 additions and 7 deletions
|
@ -115,12 +115,12 @@ INT ExecuteIf(PARSED_COMMAND *Cmd)
|
||||||
else if (Cmd->If.Operator == IF_EXIST)
|
else if (Cmd->If.Operator == IF_EXIST)
|
||||||
{
|
{
|
||||||
/* IF EXIST filename: check if file exists (wildcards allowed) */
|
/* IF EXIST filename: check if file exists (wildcards allowed) */
|
||||||
WIN32_FIND_DATA f;
|
|
||||||
HANDLE hFind;
|
|
||||||
|
|
||||||
StripQuotes(Right);
|
StripQuotes(Right);
|
||||||
|
|
||||||
hFind = FindFirstFile(Right, &f);
|
if (_tcschr(Right, _T('*')) || _tcschr(Right, _T('?')))
|
||||||
|
{
|
||||||
|
WIN32_FIND_DATA f;
|
||||||
|
HANDLE hFind = FindFirstFile(Right, &f);
|
||||||
if (hFind != INVALID_HANDLE_VALUE)
|
if (hFind != INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
|
@ -128,6 +128,11 @@ INT ExecuteIf(PARSED_COMMAND *Cmd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
result = (GetFileAttributes(Right) != INVALID_FILE_ATTRIBUTES);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
/* Do case-insensitive string comparisons if /I specified */
|
/* Do case-insensitive string comparisons if /I specified */
|
||||||
INT (*StringCmp)(LPCTSTR, LPCTSTR) =
|
INT (*StringCmp)(LPCTSTR, LPCTSTR) =
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue