Browse Source

Bug 1627: ssh:// URL is handled once for every opened instance of WinSCP too much

https://winscp.net/tracker/1627

Source commit: 7a9c41ea5c361257c3b19711963fe77b9aa87193
Martin Prikryl 7 years ago
parent
commit
7b0e7392ea
1 changed files with 8 additions and 2 deletions
  1. 8 2
      source/windows/WinMain.cpp

+ 8 - 2
source/windows/WinMain.cpp

@@ -26,6 +26,7 @@ void __fastcall GetLoginData(UnicodeString SessionName, TOptions * Options,
   TObjectList * DataList, UnicodeString & DownloadFile, bool NeedSession, TForm * LinkedForm)
 {
   bool DefaultsOnly = false;
+  bool Handled = false;
 
   UnicodeString FolderOrWorkspaceName = DecodeUrlChars(SessionName);
   if (StoredSessions->IsFolder(FolderOrWorkspaceName) ||
@@ -60,12 +61,17 @@ void __fastcall GetLoginData(UnicodeString SessionName, TOptions * Options,
         // though it's hardly of any use here.
         SessionData->ExpandEnvironmentVariables();
         OpenSessionInPutty(GUIConfiguration->PuttyPath, SessionData);
-        Abort();
+        DataList->Clear();
+        Handled = true;
       }
     }
   }
 
-  if (DefaultsOnly && !NeedSession)
+  if (Handled)
+  {
+     // noop
+  }
+  else if (DefaultsOnly && !NeedSession)
   {
     // No URL specified on command-line and no explicit command-line parameter
     // that requires session was specified => noop