Skip to content

Commit

Permalink
Don't search target application for metapath.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Jan 14, 2019
1 parent 659c470 commit e8d674c
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions metapath/src/metapath.c
Original file line number Diff line number Diff line change
Expand Up @@ -3487,13 +3487,6 @@ void LaunchTarget(LPCWSTR lpFileName, BOOL bOpenNew) {
lstrcpy(szTmp, szTargetApplication);
WCHAR szFile[MAX_PATH];
PathAbsoluteFromApp(szTmp, szFile, COUNTOF(szFile), TRUE);
if (!PathFileExists(szFile)) {
if (!SearchPath(NULL, szTmp, NULL, COUNTOF(szFile), szFile, NULL)) {
GetModuleFileName(NULL, szFile, COUNTOF(szFile));
PathRemoveFileSpec(szFile);
PathAppend(szFile, szTmp);
}
}

SHELLEXECUTEINFO sei;
ZeroMemory(&sei, sizeof(SHELLEXECUTEINFO));
Expand Down Expand Up @@ -3543,18 +3536,7 @@ void LaunchTarget(LPCWSTR lpFileName, BOOL bOpenNew) {
ExpandEnvironmentStringsEx(szTmp, COUNTOF(szTmp));

WCHAR szFile[MAX_PATH];
if (PathIsRelative(szTmp)) {
PathAbsoluteFromApp(szTmp, szFile, COUNTOF(szFile), TRUE);
if (!PathFileExists(szFile)) {
if (!SearchPath(NULL, szTmp, NULL, COUNTOF(szFile), szFile, NULL)) {
GetModuleFileName(NULL, szFile, COUNTOF(szFile));
PathRemoveFileSpec(szFile);
PathAppend(szFile, szTmp);
}
}
} else {
lstrcpy(szFile, szTmp);
}
PathAbsoluteFromApp(szTmp, szFile, COUNTOF(szFile), TRUE);

SHELLEXECUTEINFO sei;
ZeroMemory(&sei, sizeof(SHELLEXECUTEINFO));
Expand Down

0 comments on commit e8d674c

Please sign in to comment.