SharpCifs.Smb.SmbFile.PathNamesPossiblyEqual C# (CSharp) Method

PathNamesPossiblyEqual() protected method

protected PathNamesPossiblyEqual ( string path1, string path2 ) : bool
path1 string
path2 string
return bool
        protected internal virtual bool PathNamesPossiblyEqual(string path1, string path2
            )
        {
            int p1;
            int p2;
            int l1;
            int l2;
            // if unsure return this method returns true
            p1 = path1.LastIndexOf('/');
            p2 = path2.LastIndexOf('/');
            l1 = path1.Length - p1;
            l2 = path2.Length - p2;
            // anything with dots voids comparison
            if (l1 > 1 && path1[p1 + 1] == '.')
            {
                return true;
            }
            if (l2 > 1 && path2[p2 + 1] == '.')
            {
                return true;
            }
            return l1 == l2 && path1.RegionMatches(true, p1, path2, p2, l1);
        }