From 9bfd3866f7052797030896c6353430b3977b0115 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 22 Dec 2008 20:22:29 +0000 Subject: fixed anytun and anytun-controld commandline parser error (127.0.0.1:124 got no recognized properly) --- src/anyCtrOptions.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/anyCtrOptions.cpp') diff --git a/src/anyCtrOptions.cpp b/src/anyCtrOptions.cpp index cd98345..5626aec 100644 --- a/src/anyCtrOptions.cpp +++ b/src/anyCtrOptions.cpp @@ -198,6 +198,14 @@ bool Options::splitAndSetHostPort(std::string hostPort) hostPort.erase(pos, 1); } + else { + pos = hostPort.find_first_of(":"); + if(pos != std::string::npos && pos == hostPort.find_last_of(":")) { + // an ':' has been found and it is the only one -> assuming port present + hasPort = true; + hostPort[pos] = '/'; + } + } if(hasPort) { std::stringstream tmp_stream(hostPort); -- cgit v1.2.3