aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-05-29 18:53:44 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-05-29 18:53:44 +0200
commitaef40df1c432d51c5a75c9d94589a8e9577e0573 (patch)
tree816feea7f7ab2e83949bf6e8cf4a945bd0bd6342
parentebeea3fa9992d5ceb71806b24ae94c8601638717 (diff)
Improve url::string() to handle empty scheme
-rw-r--r--libbutl/url.txx10
1 files changed, 7 insertions, 3 deletions
diff --git a/libbutl/url.txx b/libbutl/url.txx
index 7e3fddb..3f07eb8 100644
--- a/libbutl/url.txx
+++ b/libbutl/url.txx
@@ -430,14 +430,18 @@ LIBBUTL_MODEXPORT namespace butl //@@ MOD Clang needs this for some reason.
if (!u.empty ())
return u;
- r += ':';
+ if (!r.empty ())
+ r += ':';
if (authority)
{
// We can't append '//' string literal, so appending characters.
//
- r += '/';
- r += '/';
+ if (!r.empty ())
+ {
+ r += '/';
+ r += '/';
+ }
r += authority->string ();
}