diff --git a/AssemblyVersion.cs b/AssemblyVersion.cs
index 4634807..66bc043 100644
--- a/AssemblyVersion.cs
+++ b/AssemblyVersion.cs
@@ -16,5 +16,5 @@ using System.Reflection;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
-[assembly: AssemblyVersion("3.0.2.539")]
-[assembly: AssemblyFileVersion("3.0.2.539")]
+[assembly: AssemblyVersion("3.0.2.540")]
+[assembly: AssemblyFileVersion("3.0.2.540")]
diff --git a/Core/SettingsStorageProvider.cs b/Core/SettingsStorageProvider.cs
index fd10786..63c237b 100644
--- a/Core/SettingsStorageProvider.cs
+++ b/Core/SettingsStorageProvider.cs
@@ -489,8 +489,9 @@ namespace ScrewTurn.Wiki {
/// The size to shrink the log to (in bytes).
private void CutLog(int size) {
lock(this) {
- // Contains the log messages from the newest to the oldest
+ // Contains the log messages from oldest to newest, and reverse the list
List entries = new List(GetLogEntries());
+ entries.Reverse();
FileInfo fi = new FileInfo(GetFullPath(LogFile));
int difference = (int)(fi.Length - size);
@@ -503,9 +504,7 @@ namespace ScrewTurn.Wiki {
toStore.Add(entries[i]);
}
- // Reverse the temp list because entries contains the log messages
- // starting from the newest to the oldest
- toStore.Reverse();
+ toStore.Sort((a, b) => a.DateTime.CompareTo(b.DateTime));
StringBuilder sb = new StringBuilder();
// Type | DateTime | Message | User
@@ -556,6 +555,9 @@ namespace ScrewTurn.Wiki {
}
catch { }
}
+
+ result.Sort((a, b) => a.DateTime.CompareTo(b.DateTime));
+
return result.ToArray();
}
}