mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 00:27:13 +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))
|
if (IsExistingFile (szPathBuffer))
|
||||||
{
|
{
|
||||||
TRACE ("Found: \'%s\'\n", debugstr_aw(szPathBuffer));
|
TRACE ("Found: \'%s\'\n", debugstr_aw(szPathBuffer));
|
||||||
_tcscpy (pFullName, szPathBuffer);
|
GetFullPathName(szPathBuffer, MAX_PATH, pFullName, NULL);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ SearchForExecutableSingle (LPCTSTR pFileName, LPTSTR pFullName, LPTSTR pPathExt,
|
||||||
if (IsExistingFile (szPathBuffer))
|
if (IsExistingFile (szPathBuffer))
|
||||||
{
|
{
|
||||||
TRACE ("Found: \'%s\'\n", debugstr_aw(szPathBuffer));
|
TRACE ("Found: \'%s\'\n", debugstr_aw(szPathBuffer));
|
||||||
_tcscpy (pFullName, szPathBuffer);
|
GetFullPathName(szPathBuffer, MAX_PATH, pFullName, NULL);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue