Browse Source

Bug 1725: Local directories with path long between 248 and 259 characters could not be created

https://winscp.net/tracker/1725
(cherry picked from commit 205a2a956ffce7a6ef887aa9d554df777af81c4c)

Source commit: fb33420ef450d8f4b0734da95c265b884b34dde4
Martin Prikryl 6 years ago
parent
commit
0df91458e7
1 changed files with 2 additions and 1 deletions
  1. 2 1
      source/core/Common.cpp

+ 2 - 1
source/core/Common.cpp

@@ -1166,7 +1166,8 @@ UnicodeString __fastcall ApiPath(UnicodeString Path)
     Path = ExpandFileName(Path);
     Path = ExpandFileName(Path);
   }
   }
 
 
-  if (Path.Length() >= MAX_PATH)
+  // Max path for directories is 12 characters shorter than max path for files
+  if (Path.Length() >= MAX_PATH - 12)
   {
   {
     if (Configuration != NULL)
     if (Configuration != NULL)
     {
     {