mirror of https://github.com/KLayout/klayout.git
Fixed URI relative path resolution if the first URI is empty.
This commit is contained in:
parent
ca1ec353fb
commit
0fbfa4dfde
|
|
@ -227,7 +227,9 @@ URI::resolved (const URI &other) const
|
|||
if (other.path ()[0] == '/') {
|
||||
res.m_path = other.path ();
|
||||
} else {
|
||||
res.m_path += "/";
|
||||
if (! res.m_path.empty ()) {
|
||||
res.m_path += "/";
|
||||
}
|
||||
res.m_path += other.path ();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,6 +78,8 @@ TEST(1)
|
|||
{
|
||||
tl::URI uri;
|
||||
EXPECT_EQ (uri2string (uri), "");
|
||||
EXPECT_EQ (uri2string (uri.resolved (tl::URI ("http://www.klayout.de"))), "<http>://<www.klayout.de>");
|
||||
EXPECT_EQ (uri2string (uri.resolved (tl::URI ("anyfile.txt"))), "<anyfile.txt>");
|
||||
|
||||
uri = tl::URI ("scheme:");
|
||||
EXPECT_EQ (uri2string (uri), "<scheme>:");
|
||||
|
|
|
|||
Loading…
Reference in New Issue