From 03d26d6ddca10fc7543b5d9fbfa896d10b848f17 Mon Sep 17 00:00:00 2001
From: Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com>
Date: Wed, 3 Jun 2015 16:35:35 -0400
Subject: [PATCH] URI: Do not add an '@' when the hostname is empty

Refs #74054

Change-Id: I7aa5fe562be722e25906ac051d5df771919b05f0
---
 src/uri.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/uri.cpp b/src/uri.cpp
index 4a4f6b2a..6e0748f6 100644
--- a/src/uri.cpp
+++ b/src/uri.cpp
@@ -516,7 +516,7 @@ QString URI::format(FlagPack<URI::Section> sections) const
    if (sections & URI::Section::USER_INFO)
       ret += d_ptr->m_Userinfo;
 
-   if (sections & URI::Section::HOSTNAME)
+   if (sections & URI::Section::HOSTNAME && !d_ptr->m_Hostname2.isEmpty())
       ret += '@' + d_ptr->m_Hostname2;
 
    if (sections & URI::Section::PORT && d_ptr->m_Port != -1)
-- 
GitLab