Make open Explorer with expeacted path in Folder as workspace

Fix #5981, close #7562
This commit is contained in:
Rajendra Singh 2019-11-13 19:28:45 +05:30 committed by Don HO
parent 8cbf3c7e29
commit 9e37a167f9
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E

View File

@ -675,8 +675,11 @@ void FileBrowser::popupMenuCmd(int cmdID)
generic_string path = getNodePath(selectedNode);
if (::PathFileExists(path.c_str()))
{
TCHAR cmdStr[1024];
wsprintf(cmdStr, TEXT("explorer /select,\"%s\""), path.c_str());
TCHAR cmdStr[1024] = {};
if (getNodeType(selectedNode) == browserNodeType_file)
wsprintf(cmdStr, TEXT("explorer /select,\"%s\""), path.c_str());
else
wsprintf(cmdStr, TEXT("explorer \"%s\""), path.c_str());
Command cmd(cmdStr);
cmd.run(nullptr);
}