Bläddra i källkod

Change: XML log tags <modification> and <permisssions> are absent, if their values are not known. Previously they would have value of 1899-12-30T01:00:00.000Z and --------- respectively. Consequently the .NET assembly RemoteFileInfo.LastWriteTime and RemoteFileInfo.FilePermissions have value DateTime.MinValue and null, respectively.

Source commit: c77e42ad5f18a069771bd8c297be11ed1fbabf99
Martin Prikryl 8 år sedan
förälder
incheckning
eaf3c193fc
1 ändrade filer med 16 tillägg och 4 borttagningar
  1. 16 4
      source/core/SessionInfo.cpp

+ 16 - 4
source/core/SessionInfo.cpp

@@ -156,8 +156,14 @@ public:
             {
               FLog->AddIndented(FORMAT(L"      <size value=\"%s\" />", (IntToStr(File->Size))));
             }
-            FLog->AddIndented(FORMAT(L"      <modification value=\"%s\" />", (StandardTimestamp(File->Modification))));
-            FLog->AddIndented(FORMAT(L"      <permissions value=\"%s\" />", (XmlAttributeEscape(File->Rights->Text))));
+            if (File->ModificationFmt != mfNone)
+            {
+              FLog->AddIndented(FORMAT(L"      <modification value=\"%s\" />", (StandardTimestamp(File->Modification))));
+            }
+            if (!File->Rights->Unknown)
+            {
+              FLog->AddIndented(FORMAT(L"      <permissions value=\"%s\" />", (XmlAttributeEscape(File->Rights->Text))));
+            }
             if (File->Owner.IsSet)
             {
               FLog->AddIndented(FORMAT(L"      <owner value=\"%s\" />", (XmlAttributeEscape(File->Owner.DisplayText))));
@@ -178,8 +184,14 @@ public:
           {
             FLog->AddIndented(FORMAT(L"    <size value=\"%s\" />", (IntToStr(FFile->Size))));
           }
-          FLog->AddIndented(FORMAT(L"    <modification value=\"%s\" />", (StandardTimestamp(FFile->Modification))));
-          FLog->AddIndented(FORMAT(L"    <permissions value=\"%s\" />", (XmlAttributeEscape(FFile->Rights->Text))));
+          if (FFile->ModificationFmt != mfNone)
+          {
+            FLog->AddIndented(FORMAT(L"    <modification value=\"%s\" />", (StandardTimestamp(FFile->Modification))));
+          }
+          if (!FFile->Rights->Unknown)
+          {
+            FLog->AddIndented(FORMAT(L"    <permissions value=\"%s\" />", (XmlAttributeEscape(FFile->Rights->Text))));
+          }
           FLog->AddIndented(L"  </file>");
         }
         if (FState == RolledBack)