Commit b23d90a5 authored by Damjan Jovanovic's avatar Damjan Jovanovic Committed by Alexandre Julliard

ws2_32: gethostbyname("") should work.

parent cb029e0b
......@@ -3222,7 +3222,7 @@ struct WS_hostent* WINAPI WS_gethostbyname(const char* name)
int locerr = ENOBUFS;
#endif
char buf[100];
if( !name) {
if( !name || !name[0]) {
name = buf;
if( gethostname( buf, 100) == -1) {
SetLastError( WSAENOBUFS); /* appropriate ? */
......
......@@ -1665,6 +1665,14 @@ static void test_getsockname(void)
WSACleanup();
}
static void test_dns(void)
{
struct hostent *h;
h = gethostbyname("");
ok(h != NULL, "gethostbyname(\"\") failed with %d\n", h_errno);
}
static void test_inet_addr(void)
{
u_long addr;
......@@ -1850,6 +1858,7 @@ START_TEST( sock )
test_accept();
test_getsockname();
test_inet_addr();
test_dns();
test_send();
test_write_events();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment