File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -1156,18 +1156,15 @@ static void AppendExternalViewersToMenu(HMENU menuFile, const WCHAR* filePath) {
11561156 }
11571157
11581158 WCHAR* name = ToWstrTemp (ev->name );
1159- if (str::EmptyOrWhiteSpaceOnly (ev->name )) {
1159+ if (!ev-> name || str::EmptyOrWhiteSpaceOnly (ev->name )) {
11601160 CmdLineArgsIter args (ToWstrTemp (ev->commandLine ));
1161- int nArgs = args.nArgs - 2 ;
1162- if (nArgs <= 0 ) {
1161+ int nArgs = args.nArgs ;
1162+ if (nArgs < 1 ) {
11631163 continue ;
11641164 }
1165- WCHAR* arg0 = args.at (2 + 0 );
1166- name = str::DupTemp (path::GetBaseNameTemp (arg0));
1167- WCHAR* ext = (WCHAR*)path::GetExtTemp (name);
1168- if (ext) {
1169- *ext = 0 ;
1170- }
1165+ WCHAR* exePath = args.at (0 );
1166+ const WCHAR* exeName = path::GetBaseNameTemp (exePath);
1167+ name = str::DupTemp (exeName);
11711168 }
11721169
11731170 AutoFreeWstr menuString (str::Format (_TR (" Open in %s" ), name));
You can’t perform that action at this time.
0 commit comments