+ fix: Path_ToShortPathName() for grepWinNP3 startup

This commit is contained in:
METANEOCORTEX\Kotti 2021-11-08 12:13:08 +01:00
parent 49a456af5b
commit 2ef2ffb8c6
2 changed files with 6 additions and 2 deletions

View File

@ -4782,8 +4782,10 @@ void DialogGrepWin(HWND hwnd, LPCWSTR searchPattern)
// relative grepWinNP3.ini path (for shorter cmdline)
if (Path_RelativePathTo(hTemp, hGrepWinDir, FILE_ATTRIBUTE_DIRECTORY, hGrepWinIniPath, FILE_ATTRIBUTE_NORMAL)) {
Path_Swap(hGrepWinIniPath, hTemp);
}
Path_ToShortPathName(hGrepWinIniPath);
}
else {
Path_ToShortPathName(hGrepWinIniPath);
}
StrgFormat(hstrParams, L"/portable /content %s /inipath:\"%s\"", StrgGet(hstrOptions), Path_Get(hGrepWinIniPath));
} else {
StrgFormat(hstrParams, L"/portable /content %s", StrgGet(hstrOptions));

View File

@ -1318,7 +1318,9 @@ size_t PTHAPI Path_ToShortPathName(HPATHL hpth_in_out)
DWORD const _len = GetShortPathNameW(StrgGet(hstr_io), NULL, 0);
if (!_len) {
#ifdef DEBUG
MsgBoxLastError(L"Path_ToShortPathName()", 0);
#endif // DEBUG
return 0;
}
LPWSTR const buf = StrgWriteAccessBuf(hstr_io, _len);