diff --git a/src/ProcessInfo.cpp b/src/ProcessInfo.cpp index a3276f40a..d716248c0 100644 --- a/src/ProcessInfo.cpp +++ b/src/ProcessInfo.cpp @@ -1071,15 +1071,6 @@ QString SSHProcessInfo::format(const QString& input) const { QString output(input); - // test whether host is an ip address - // in which case 'short host' and 'full host' - // markers in the input string are replaced with - // the full address - bool isIpAddress = false; - - struct in_addr address; - isIpAddress = inet_aton(_host.toLocal8Bit().constData(), &address) != 0; - // search for and replace known markers output.replace(QLatin1String("%u"), _user); @@ -1093,6 +1084,12 @@ QString SSHProcessInfo::format(const QString& input) const else output.replace(QLatin1String("%U"), _user + '@'); + // test whether host is an ip address + // in which case 'short host' and 'full host' + // markers in the input string are replaced with + // the full address + struct in_addr address; + const bool isIpAddress = inet_aton(_host.toLocal8Bit().constData(), &address) != 0; if (isIpAddress) output.replace(QLatin1String("%h"), _host); else