diff options
author | Norbert Frese <postfach@nfrese.net> | 2004-03-16 09:47:14 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2004-03-16 09:47:14 +0000 |
commit | 27729a060cab0a469ae820008623413774a70180 (patch) | |
tree | e43c2575594d50d6d90522ea9c842ef4d9b09b74 | |
parent | 6828de5bff76e237ba55ca2885a0ed31f8efe44b (diff) | |
download | gcc-27729a060cab0a469ae820008623413774a70180.zip gcc-27729a060cab0a469ae820008623413774a70180.tar.gz gcc-27729a060cab0a469ae820008623413774a70180.tar.bz2 |
2004-03-16 Norbert Frese <postfach@nfrese.net>
* java/net/InetAddress.java
(getByName): Handle hostname == "" case.
From-SVN: r79529
-rw-r--r-- | libjava/ChangeLog | 5 | ||||
-rw-r--r-- | libjava/java/net/InetAddress.java | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index a027136..8ce6ccf 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2004-03-16 Norbert Frese <postfach@nfrese.net> + + * java/net/InetAddress.java + (getByName): Handle hostname == "" case. + 2004-03-16 Dalibor Topic <robilad@kaffe.org> Reported by: Adam Heath <doogie@debian.org> diff --git a/libjava/java/net/InetAddress.java b/libjava/java/net/InetAddress.java index 0a69c1a..e5f6ba3 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 |