ws2_32: gethostbyname("") should work.
This commit is contained in:
parent
cb029e0b30
commit
b23d90a543
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue