Przeglądaj źródła

Bug 1942: Failure when looking for PuTTY key tools and the PATH contain invalid paths

https://winscp.net/tracker/1942

Source commit: 4b38d50f6629b07742117bd3d077039762fdc353
Martin Prikryl 4 lat temu
rodzic
commit
8537cc6702
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      source/windows/GUITools.cpp

+ 2 - 1
source/windows/GUITools.cpp

@@ -80,7 +80,8 @@ bool __fastcall FindFile(UnicodeString & Path)
         while (!Result && !Paths.IsEmpty())
         {
           UnicodeString P = CutToChar(Paths, L';', false);
-          NewPath = TPath::Combine(P, Path);
+          // Not using TPath::Combine as it throws on an invalid path and PATH is not under our control
+          NewPath = IncludeTrailingBackslash(P) + Path;
           Result = FileExistsFix(NewPath);
           if (Result)
           {