Kaynağa Gözat

Change: RemoteFileInfo.FileType now consistently returns 'L' for symlinks as was always documented + RemoteFileInfo.FileType now consistently returns uppercase value as was always documented.

Source commit: c2b10a42d337d6adba69369cdae82e2d65397bef
Martin Prikryl 6 yıl önce
ebeveyn
işleme
63acc45b4b
2 değiştirilmiş dosya ile 10 ekleme ve 4 silme
  1. 9 3
      source/core/RemoteFiles.cpp
  2. 1 1
      source/core/SessionInfo.cpp

+ 9 - 3
source/core/RemoteFiles.cpp

@@ -927,7 +927,14 @@ void __fastcall TRemoteFile::SetIsHidden(bool value)
 //---------------------------------------------------------------------------
 Boolean __fastcall TRemoteFile::GetIsDirectory() const
 {
-  return (toupper(Type) == FILETYPE_DIRECTORY);
+  if (IsSymLink && (FLinkedFile != NULL))
+  {
+    return FLinkedFile->IsDirectory;
+  }
+  else
+  {
+    return (toupper(Type) == FILETYPE_DIRECTORY);
+  }
 }
 //---------------------------------------------------------------------------
 Boolean __fastcall TRemoteFile::GetIsParentDirectory() const
@@ -960,8 +967,7 @@ Boolean __fastcall TRemoteFile::GetIsInaccesibleDirectory() const
 //---------------------------------------------------------------------------
 wchar_t __fastcall TRemoteFile::GetType() const
 {
-  if (IsSymLink && FLinkedFile) return FLinkedFile->Type;
-    else return FType;
+  return FType;
 }
 //---------------------------------------------------------------------------
 void __fastcall TRemoteFile::SetType(wchar_t AType)

+ 1 - 1
source/core/SessionInfo.cpp

@@ -405,7 +405,7 @@ protected:
   {
     FLog->AddIndented(Indent + L"<file>");
     FLog->AddIndented(Indent + FORMAT(L"  <filename value=\"%s\" />", (XmlAttributeEscape(File->FileName))));
-    FLog->AddIndented(Indent + FORMAT(L"  <type value=\"%s\" />", (XmlAttributeEscape(File->Type))));
+    FLog->AddIndented(Indent + FORMAT(L"  <type value=\"%s\" />", (XmlAttributeEscape(towupper(File->Type)))));
     if (!File->IsDirectory)
     {
       FLog->AddIndented(Indent + FORMAT(L"  <size value=\"%s\" />", (IntToStr(File->Size))));