mirror of
https://github.com/reactos/reactos.git
synced 2026-06-01 08:50:24 +08:00
[CMD] Use GetFullPathName instead of copying buffers when resolving executable names
This properly strips spaces & dots at the end of the file. Fixes the infinite loop with CreateProcess calling cmd over and over with e.g. 'cmd /c "some_script.bat "' Uncovered by recent ShellExecuteEx tests Dedicated to Katayama for the trigger & Hermès for the tests
This commit is contained in:
committed by
Jérôme Gardou
parent
94d9e9c2a8
commit
521d330d04
@@ -106,7 +106,7 @@ SearchForExecutableSingle (LPCTSTR pFileName, LPTSTR pFullName, LPTSTR pPathExt,
|
||||
if (IsExistingFile (szPathBuffer))
|
||||
{
|
||||
TRACE ("Found: \'%s\'\n", debugstr_aw(szPathBuffer));
|
||||
_tcscpy (pFullName, szPathBuffer);
|
||||
GetFullPathName(szPathBuffer, MAX_PATH, pFullName, NULL);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ SearchForExecutableSingle (LPCTSTR pFileName, LPTSTR pFullName, LPTSTR pPathExt,
|
||||
if (IsExistingFile (szPathBuffer))
|
||||
{
|
||||
TRACE ("Found: \'%s\'\n", debugstr_aw(szPathBuffer));
|
||||
_tcscpy (pFullName, szPathBuffer);
|
||||
GetFullPathName(szPathBuffer, MAX_PATH, pFullName, NULL);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user