Skip to content

Commit

Permalink
Don't be case-sensitive when comparing paths in the file watcher
Browse files Browse the repository at this point in the history
Fixes #256
  • Loading branch information
canton7 committed Apr 26, 2016
1 parent c9c2860 commit ffd5574
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/SyncTrayzor/Services/DirectoryWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private string FindCommonPrefix(string path1, string path2)
var result = new List<string>();
for (int i = 0; i < Math.Min(parts1.Length, parts2.Length); i++)
{
if (parts1[i] != parts2[i])
if (!String.Equals(parts1[i], parts2[i], StringComparison.OrdinalIgnoreCase))
break;

result.Add(parts1[i]);
Expand Down
3 changes: 2 additions & 1 deletion src/SyncTrayzor/Services/FileWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ private void RecordPathChange(string path, bool pathExists)
if (pathExists)
path = this.GetLongPathName(path);

if (!path.StartsWith(this.Directory))
// https://msdn.microsoft.com/en-us/library/dd465121.aspx
if (!path.StartsWith(this.Directory, StringComparison.OrdinalIgnoreCase))
return;

var subPath = path.Substring(this.Directory.Length);
Expand Down

0 comments on commit ffd5574

Please sign in to comment.