[CMD] Correctly parse drive-decorated pathname (#2382)

Correctly interpret the drive-decorated pathnames (C: or D:dir1 etc). CORE-15871
This commit is contained in:
Katayama Hirofumi MZ 2020-02-26 22:28:02 +09:00 committed by GitHub
parent 554c41e4d7
commit a9760098f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1770,7 +1770,14 @@ ResolvePattern(
* they are part of the actual directory path; the exception being if
* these are the special "." or ".." directories.
*/
if (pszPatternPart == NULL)
if (_istalpha(pNextDir[0]) && pNextDir[1] == _T(':') && pNextDir[2] != _T('\\'))
{
/*
* The syntax "<drive_letter>:" without any trailing backslash actually
* means: "current directory on this drive".
*/
}
else if (pszPatternPart == NULL)
{
ASSERT(pszFullPath[_tcslen(pszFullPath)-1] == _T('\\'));