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: ba1e09af1b38ac6a9693047f33bbb759cf265ed1
Martin Prikryl 6 years ago
parent
commit
a8f95f78f2
1 changed files with 2 additions and 1 deletions
  1. 2 1
      source/core/Common.cpp

+ 2 - 1
source/core/Common.cpp

@@ -1117,7 +1117,8 @@ UnicodeString __fastcall ApiPath(UnicodeString 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)
     {