https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d32858413d9bd5153153b…
commit d32858413d9bd5153153be2168702691d2559d98
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Sat Apr 25 11:01:20 2020 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Sat Apr 25 11:01:20 2020 +0900
[SHELL32] Command 'start C:' should open 'C:\' (#2642)
Based on JIRA user amaneureka's idea.
In SHELL_execute function, add a backslash for Drive "C:", "D:" or
"E:" etc.
CORE-16384
---
dll/win32/shell32/shlexec.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/dll/win32/shell32/shlexec.cpp b/dll/win32/shell32/shlexec.cpp
index 3514c9c380a..4e31cfff625 100644
--- a/dll/win32/shell32/shlexec.cpp
+++ b/dll/win32/shell32/shlexec.cpp
@@ -1824,6 +1824,14 @@ static BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32
execfunc)
if(l > dwApplicationNameLen) dwApplicationNameLen = l + 1;
wszApplicationName = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, dwApplicationNameLen
* sizeof(WCHAR));
memcpy(wszApplicationName, sei_tmp.lpFile, l * sizeof(WCHAR));
+
+ if (wszApplicationName[2] == 0 && wszApplicationName[1] == L':'
&&
+ ((L'A' <= wszApplicationName[0] && wszApplicationName[0]
<= L'Z') ||
+ (L'a' <= wszApplicationName[0] && wszApplicationName[0]
<= L'z')))
+ {
+ // 'C:' --> 'C:\'
+ PathAddBackslashW(wszApplicationName);
+ }
}
wszParameters = parametersBuffer;