Another tweak to account for when both paths end with '/'.

The problem here is making sure that path_prefix_is() behaves exactly
as would a case insensitive prefixIs(). Anyway, this is still better
than trying to fix the semantics of common_path().


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29846 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Enrico Forestieri 2009-05-25 18:37:03 +00:00
parent 2fb21c28b5
commit 70351330a0
3 changed files with 3 additions and 3 deletions

View File

@ -181,7 +181,7 @@ bool path_prefix_is(string & path, string const & pre, path_case how)
docstring::size_type const p2_len = p2.length();
docstring::size_type common_len = common_path(p1, p2);
if (p2[p2_len - 1] == '/')
if (p2[p2_len - 1] == '/' && p1_len != p2_len)
++common_len;
if (common_len != p2_len)

View File

@ -94,7 +94,7 @@ bool path_prefix_is(string & path, string const & pre, path_case how)
docstring::size_type const p2_len = p2.length();
docstring::size_type common_len = common_path(p1, p2);
if (p2[p2_len - 1] == '/')
if (p2[p2_len - 1] == '/' && p1_len != p2_len)
++common_len;
if (common_len != p2_len)

View File

@ -212,7 +212,7 @@ bool path_prefix_is(string & path, string const & pre, path_case how)
docstring::size_type const p2_len = p2.length();
docstring::size_type common_len = common_path(p1, p2);
if (p2[p2_len - 1] == '/')
if (p2[p2_len - 1] == '/' && p1_len != p2_len)
++common_len;
if (common_len != p2_len)