Browse Source

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

https://winscp.net/tracker/1725

Source commit: fe5790b9331bec35a1dedb41edbd32e58db772f6
Martin Prikryl 6 years ago
parent
commit
205a2a956f
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);
   }
 
-  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)
     {