diff options
author | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-03-16 09:47:14 +0000 |
---|---|---|
committer | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-03-16 09:47:14 +0000 |
commit | 210cbb66660e837854cb18d6ae3781c327feb5de (patch) | |
tree | e43c2575594d50d6d90522ea9c842ef4d9b09b74 /libjava/java/net/InetAddress.java | |
parent | 63f0dffdc0d71302d7fe2f4f3346d40c3643338a (diff) | |
download | ppe42-gcc-210cbb66660e837854cb18d6ae3781c327feb5de.tar.gz ppe42-gcc-210cbb66660e837854cb18d6ae3781c327feb5de.zip |
2004-03-16 Norbert Frese <postfach@nfrese.net>
* java/net/InetAddress.java
(getByName): Handle hostname == "" case.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@79529 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/net/InetAddress.java')
-rw-r--r-- | libjava/java/net/InetAddress.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libjava/java/net/InetAddress.java b/libjava/java/net/InetAddress.java index 0a69c1aab07..e5f6ba3a8a1 100644 --- a/libjava/java/net/InetAddress.java +++ b/libjava/java/net/InetAddress.java @@ -573,7 +573,7 @@ public class InetAddress implements Serializable * Returns an InetAddress object representing the IP address of the given * hostname. This name can be either a hostname such as "www.urbanophile.com" * or an IP address in dotted decimal format such as "127.0.0.1". If the - * hostname is null, the hostname of the local machine is supplied by + * hostname is null or "", the hostname of the local machine is supplied by * default. This method is equivalent to returning the first element in * the InetAddress array returned from GetAllByName. * @@ -594,7 +594,7 @@ public class InetAddress implements Serializable s.checkConnect (hostname, -1); // Default to current host if necessary - if (hostname == null) + if (hostname == null || hostname.length() == 0) return getLocalHost(); // Assume that the host string is an IP address |