Преглед на файлове

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

https://winscp.net/tracker/1627
(cherry picked from commit 7b0e7392ea36e81f1ee44a56b708242b76832d50)

Source commit: d1c65d411dbca8a57d03a72196b780fa8d1132b9
Martin Prikryl преди 7 години
родител
ревизия
1e574b166c
променени са 1 файла, в които са добавени 8 реда и са изтрити 2 реда
  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)
   TObjectList * DataList, UnicodeString & DownloadFile, bool NeedSession, TForm * LinkedForm)
 {
 {
   bool DefaultsOnly = false;
   bool DefaultsOnly = false;
+  bool Handled = false;
 
 
   UnicodeString FolderOrWorkspaceName = DecodeUrlChars(SessionName);
   UnicodeString FolderOrWorkspaceName = DecodeUrlChars(SessionName);
   if (StoredSessions->IsFolder(FolderOrWorkspaceName) ||
   if (StoredSessions->IsFolder(FolderOrWorkspaceName) ||
@@ -60,12 +61,17 @@ void __fastcall GetLoginData(UnicodeString SessionName, TOptions * Options,
         // though it's hardly of any use here.
         // though it's hardly of any use here.
         SessionData->ExpandEnvironmentVariables();
         SessionData->ExpandEnvironmentVariables();
         OpenSessionInPutty(GUIConfiguration->PuttyPath, SessionData);
         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
     // No URL specified on command-line and no explicit command-line parameter
     // that requires session was specified => noop
     // that requires session was specified => noop