]>
Commit | Line | Data |
---|---|---|
04843bd3 PS |
1 | Index: ktelnetservice.cpp |
2 | =================================================================== | |
3 | RCS file: /home/kde/kdelibs/kio/misc/ktelnetservice.cpp,v | |
4 | retrieving revision 1.7.2.1 | |
5 | diff -u -p -r1.7.2.1 ktelnetservice.cpp | |
6 | --- kio/misc/ktelnetservice.cpp 18 Feb 2004 11:42:12 -0000 1.7.2.1 | |
7 | +++ kio/misc/ktelnetservice.cpp 13 May 2004 15:12:14 -0000 | |
8 | @@ -77,10 +77,19 @@ int main(int argc, char **argv) | |
9 | cmd << url.user(); | |
10 | } | |
11 | ||
12 | + QString host; | |
13 | if (!url.host().isEmpty()) | |
14 | - cmd << url.host(); // telnet://host | |
15 | + host = url.host(); // telnet://host | |
16 | else if (!url.path().isEmpty()) | |
17 | - cmd << url.path(); // telnet:host | |
18 | + host = url.path(); // telnet:host | |
19 | + | |
20 | + if (host.isEmpty() || host.startsWith("-")) | |
21 | + { | |
22 | + kdError() << "Invalid hostname " << host << endl; | |
23 | + return 2; | |
24 | + } | |
25 | + | |
26 | + cmd << host; | |
27 | ||
28 | if (url.port()){ | |
29 | if ( url.protocol() == "ssh" ) |