[synchronicity-commits] SF.net SVN: synchronicity:[1471] trunk/Create Synchronicity
Easy, fast, and lightweight backup and synchronization app for Windows
Brought to you by:
createsoftware
From: <cre...@us...> - 2011-11-20 15:49:31
|
Revision: 1471 http://synchronicity.svn.sourceforge.net/synchronicity/?rev=1471&view=rev Author: createsoftware Date: 2011-11-20 15:49:24 +0000 (Sun, 20 Nov 2011) Log Message: ----------- Check if Labels has been assigned before reading from it. Rewrite a few comments in the TranslatePath[_Unsafe] routines, and let null paths through. Craeful: if paths are not set (ie if the configuration dictionary has been cleared, since the code wouldn't reach that point otherwise), then LeftRootPath and RightRootPath remain null all along. Modified Paths: -------------- trunk/Create Synchronicity/Interface/SynchronizeForm.vb trunk/Create Synchronicity/Profile settings.vb trunk/Create Synchronicity/Revision.vb Modified: trunk/Create Synchronicity/Interface/SynchronizeForm.vb =================================================================== --- trunk/Create Synchronicity/Interface/SynchronizeForm.vb 2011-11-20 11:44:54 UTC (rev 1470) +++ trunk/Create Synchronicity/Interface/SynchronizeForm.vb 2011-11-20 15:49:24 UTC (rev 1471) @@ -287,9 +287,11 @@ FoldersCreated.Text = Status.CreatedFolders & "/" & Status.FoldersToCreate SyncLock Lock - Step1StatusLabel.Text = Labels(1) - Step2StatusLabel.Text = Labels(2) - Step3StatusLabel.Text = Labels(3) + If Labels IsNot Nothing Then + Step1StatusLabel.Text = Labels(1) + Step2StatusLabel.Text = Labels(2) + Step3StatusLabel.Text = Labels(3) + End If Interaction.StatusIcon.Text = StatusLabel End SyncLock End Sub Modified: trunk/Create Synchronicity/Profile settings.vb =================================================================== --- trunk/Create Synchronicity/Profile settings.vb 2011-11-20 11:44:54 UTC (rev 1470) +++ trunk/Create Synchronicity/Profile settings.vb 2011-11-20 15:49:24 UTC (rev 1471) @@ -93,7 +93,7 @@ Try ConfigLine = FileReader.ReadLine() Dim Param() As String = ConfigLine.Split(":".ToCharArray, 2) - If Not Configuration.ContainsKey(Param(0)) Then Configuration.Add(Param(0), Param(1)) + If Not (ConfigLine = "" Or Configuration.ContainsKey(Param(0))) Then Configuration.Add(Param(0), Param(1)) Catch ex As IndexOutOfRangeException Interaction.ShowMsg(String.Format(Translation.Translate("\INVALID_SETTING"), ConfigLine)) Catch ex As Exception 'Something worse than finding a simple misformatted line has occured @@ -286,8 +286,8 @@ End Sub Public Shared Function TranslatePath(ByVal Path As String) As String + If Path Is Nothing Then Return Nothing Return TranslatePath_Unsafe(Path).TrimEnd(ProgramSetting.DirSep) 'Careful with Linux root - 'This part is just for the extra safety, since a fix is also included in TranslatePath_Unsafe. 'Prevents a very annoying bug, where the presence of a slash at the end of the base directory would confuse the engine (#3052979) End Function @@ -319,9 +319,9 @@ If Path.StartsWith("""") And Not Label = "" Then For Each Drive As IO.DriveInfo In IO.DriveInfo.GetDrives - 'The drive's name ends with a "\". If RelativePath = "", then TrimEnd on the RelativePath won't do anything. - 'This is the line why this function is called unsafe, but it's been made safe anyway: dirty code that get fixed later on crosses me. The point is that a source/destination path should *never* end with a DirSep, otherwise the system gets confused as to what is a relative path and what is the base path. + 'The drive's name ends with a "\". If RelativePath = "", then TrimEnd on the RelativePath won't do anything; that's why you trim after joining If Not Drive.Name(0) = "A"c AndAlso Drive.IsReady AndAlso String.Compare(Drive.VolumeLabel, Label, True) = 0 Then + 'This is the line why this function is called unsafe: no path should *ever* end with a DirSep, otherwise the system gets confused as to what base and added path sections are. Translated_Path = (Drive.Name & RelativePath.TrimStart(ProgramSetting.DirSep)).TrimEnd(ProgramSetting.DirSep) 'Bug #3052979 Exit For End If Modified: trunk/Create Synchronicity/Revision.vb =================================================================== --- trunk/Create Synchronicity/Revision.vb 2011-11-20 11:44:54 UTC (rev 1470) +++ trunk/Create Synchronicity/Revision.vb 2011-11-20 15:49:24 UTC (rev 1471) @@ -1,3 +1,3 @@ Module Revision - Public Const Build As Integer = 1469 + Public Const Build As Integer = 1470 End Module This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |