Explorar el Código

Bug 1499: Configuring a PuTTY path with unclosed quotes prevents WinSCP from starting

https://winscp.net/tracker/1499

Source commit: 8762d3a2e8983a616f5f6d03385c24339e3bac4f
Martin Prikryl hace 8 años
padre
commit
eb8201863d
Se han modificado 3 ficheros con 17 adiciones y 0 borrados
  1. 15 0
      source/forms/Preferences.cpp
  2. 1 0
      source/forms/Preferences.dfm
  3. 1 0
      source/forms/Preferences.h

+ 15 - 0
source/forms/Preferences.cpp

@@ -2768,3 +2768,18 @@ void __fastcall TPreferencesDialog::LogMaxSizeComboExit(TObject * /*Sender*/)
   }
 }
 //---------------------------------------------------------------------------
+void __fastcall TPreferencesDialog::PuttyPathEditExit(TObject * /*Sender*/)
+{
+  try
+  {
+    UnicodeString Program, AParams, Dir;
+    SplitCommand(PuttyPathEdit->Text, Program, AParams, Dir);
+  }
+  catch(...)
+  {
+    PuttyPathEdit->SelectAll();
+    PuttyPathEdit->SetFocus();
+    throw;
+  }
+}
+//---------------------------------------------------------------------------

+ 1 - 0
source/forms/Preferences.dfm

@@ -2564,6 +2564,7 @@ object PreferencesDialog: TPreferencesDialog
             Anchors = [akLeft, akTop, akRight]
             TabOrder = 0
             OnChange = PuttyPathEditChange
+            OnExit = PuttyPathEditExit
           end
           object PuttyPasswordCheck2: TCheckBox
             Left = 24

+ 1 - 0
source/forms/Preferences.h

@@ -405,6 +405,7 @@ __published:
   void __fastcall ConfigureCommandButtonClick(TObject *Sender);
   void __fastcall LanguagesViewCustomDrawItem(TCustomListView * Sender, TListItem * Item, TCustomDrawState State, bool & DefaultDraw);
   void __fastcall LogMaxSizeComboExit(TObject *Sender);
+  void __fastcall PuttyPathEditExit(TObject *Sender);
 
 private:
   TPreferencesMode FPreferencesMode;