diff --git a/SparkleShare/SparkleEventLogController.cs b/SparkleShare/SparkleEventLogController.cs index 57d52305..2e3276c3 100755 --- a/SparkleShare/SparkleEventLogController.cs +++ b/SparkleShare/SparkleEventLogController.cs @@ -563,7 +563,7 @@ namespace SparkleShare { if (string.IsNullOrEmpty (crumb)) continue; - string crumb_path = Path.Combine (new_path_root, crumb); + string crumb_path = SafeCombine (new_path_root, crumb); if (Directory.Exists (crumb_path)) { link += "" + crumb + Path.DirectorySeparatorChar + ""; @@ -581,7 +581,7 @@ namespace SparkleShare { previous_was_folder = false; } - new_path_root = Path.Combine (new_path_root, crumb); + new_path_root = SafeCombine (new_path_root, crumb); i++; } @@ -589,6 +589,20 @@ namespace SparkleShare { } + private string SafeCombine (string path1, string path2) + { + string result = path1; + + if (!result.EndsWith (Path.DirectorySeparatorChar.ToString ())) + result += Path.DirectorySeparatorChar; + + if (path2.StartsWith (Path.DirectorySeparatorChar.ToString ())) + path2 = path2.Substring (1); + + return result + path2; + } + + // All change sets that happened on a day private class ActivityDay : List {