https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a9760098f7c944961a3ea…
commit a9760098f7c944961a3ea674750c0c6240713ead
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Wed Feb 26 22:28:02 2020 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Wed Feb 26 22:28:02 2020 +0900
[CMD] Correctly parse drive-decorated pathname (#2382)
Correctly interpret the drive-decorated pathnames (C: or D:dir1 etc). CORE-15871
---
base/shell/cmd/dir.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/base/shell/cmd/dir.c b/base/shell/cmd/dir.c
index e6c2f869111..5750dd236b8 100644
--- a/base/shell/cmd/dir.c
+++ b/base/shell/cmd/dir.c
@@ -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('\\'));