mirror of
https://github.com/KLayout/klayout.git
synced 2026-09-07 03:21:34 +02:00
Fixed URI relative path resolution if the first URI is empty.
This commit is contained in:
+3
-1
@@ -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>:");
|
||||
|
||||
Reference in New Issue
Block a user