mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
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:
parent
2fb21c28b5
commit
70351330a0
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user