diff --git a/src/tl/tl/tlUri.cc b/src/tl/tl/tlUri.cc index 21c9f0ece..5eb43d39b 100644 --- a/src/tl/tl/tlUri.cc +++ b/src/tl/tl/tlUri.cc @@ -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 (); } } diff --git a/src/tl/unit_tests/tlUriTests.cc b/src/tl/unit_tests/tlUriTests.cc index b240afb37..562c0280b 100644 --- a/src/tl/unit_tests/tlUriTests.cc +++ b/src/tl/unit_tests/tlUriTests.cc @@ -78,6 +78,8 @@ TEST(1) { tl::URI uri; EXPECT_EQ (uri2string (uri), ""); + EXPECT_EQ (uri2string (uri.resolved (tl::URI ("http://www.klayout.de"))), "://"); + EXPECT_EQ (uri2string (uri.resolved (tl::URI ("anyfile.txt"))), ""); uri = tl::URI ("scheme:"); EXPECT_EQ (uri2string (uri), ":");