diff --git a/src/Dialogs.c b/src/Dialogs.c index b2ec7f3d7..44831c381 100644 --- a/src/Dialogs.c +++ b/src/Dialogs.c @@ -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)); diff --git a/src/PathLib.c b/src/PathLib.c index 926ba7cba..cea94567b 100644 --- a/src/PathLib.c +++ b/src/PathLib.c @@ -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);