mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 03:11:59 +00:00
Account for the weird case where p2 is longer than p1, such as p1 == "path"
and p2 == "Path/". This would be really weird, but one never knows... git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29855 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
b3fe7330de
commit
5fb0ed491c
@ -187,8 +187,13 @@ bool path_prefix_is(string & path, string const & pre, path_case how)
|
|||||||
if (common_len != p2_len)
|
if (common_len != p2_len)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (how == CASE_ADJUSTED && !prefixIs(path, pre))
|
if (how == CASE_ADJUSTED && !prefixIs(path, pre)) {
|
||||||
path = to_utf8(p2 + p1.substr(common_len, p1_len - common_len));
|
if (p1_len < common_len)
|
||||||
|
path = to_utf8(p2.substr(0, p1_len));
|
||||||
|
else
|
||||||
|
path = to_utf8(p2 + p1.substr(common_len,
|
||||||
|
p1_len - common_len));
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -100,8 +100,13 @@ bool path_prefix_is(string & path, string const & pre, path_case how)
|
|||||||
if (common_len != p2_len)
|
if (common_len != p2_len)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (how == CASE_ADJUSTED && !prefixIs(path, pre))
|
if (how == CASE_ADJUSTED && !prefixIs(path, pre)) {
|
||||||
path = to_utf8(p2 + p1.substr(common_len, p1_len - common_len));
|
if (p1_len < common_len)
|
||||||
|
path = to_utf8(p2.substr(0, p1_len));
|
||||||
|
else
|
||||||
|
path = to_utf8(p2 + p1.substr(common_len,
|
||||||
|
p1_len - common_len));
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
#else
|
#else
|
||||||
|
@ -218,8 +218,13 @@ bool path_prefix_is(string & path, string const & pre, path_case how)
|
|||||||
if (common_len != p2_len)
|
if (common_len != p2_len)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (how == CASE_ADJUSTED && !prefixIs(path, pre))
|
if (how == CASE_ADJUSTED && !prefixIs(path, pre)) {
|
||||||
path = to_utf8(p2 + p1.substr(common_len, p1_len - common_len));
|
if (p1_len < common_len)
|
||||||
|
path = to_utf8(p2.substr(0, p1_len));
|
||||||
|
else
|
||||||
|
path = to_utf8(p2 + p1.substr(common_len,
|
||||||
|
p1_len - common_len));
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user