mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00: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:
parent
94d9e9c2a8
commit
521d330d04
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue