summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2008-12-22 20:22:29 +0000
committerChristian Pointner <equinox@anytun.org>2008-12-22 20:22:29 +0000
commit9bfd3866f7052797030896c6353430b3977b0115 (patch)
treecbcb0bdc65a6d6022831c6e8ec0a279ab7d9f90d /src
parentsome cleanup (diff)
fixed anytun and anytun-controld commandline parser error (127.0.0.1:124 got no recognized properly)
Diffstat (limited to 'src')
-rw-r--r--src/anyCtrOptions.cpp8
-rw-r--r--src/options.cpp8
2 files changed, 16 insertions, 0 deletions
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);
diff --git a/src/options.cpp b/src/options.cpp
index 45db202..ff09229 100644
--- a/src/options.cpp
+++ b/src/options.cpp
@@ -250,6 +250,14 @@ bool Options::splitAndAddHostPort(std::string hostPort, ConnectToList& list)
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);