Explorar o código

Bug 2082: Workaround for calls to system API failing when used first time against some network shares (Samba) with paths over the legacy Windows limit

https://winscp.net/tracker/2082

Source commit: 382de6e533d4ac3c8161b9c282741491fb08dc97
Martin Prikryl %!s(int64=3) %!d(string=hai) anos
pai
achega
7fca46e47d
Modificáronse 1 ficheiros con 9 adicións e 1 borrados
  1. 9 1
      source/core/Common.cpp

+ 9 - 1
source/core/Common.cpp

@@ -1597,7 +1597,15 @@ int __fastcall FileGetAttrFix(const UnicodeString FileName)
   {
     FollowLink = false;
   }
-  int Result = FileGetAttr(FileName, FollowLink);
+  int Result;
+  try
+  {
+    Result = FileGetAttr(FileName, FollowLink);
+  }
+  catch (EOSError & E)
+  {
+    Result = -1;
+  }
   if (Result < 0)
   {
     // When referring to files in some special symlinked locations