X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=ext%2FSocket%2FSocket.xs;h=cefcb244229e6aee0db86acad781529d3246346c;hb=ac9fe1c23eac5f442f32542eeea699c9f084bf60;hp=82ed442ed664e20926cd34e3832a132ee1316313;hpb=26893f8d4c7b51d5bfa4e21e347c404f5c2964af;p=p5sagit%2Fp5-mst-13.2.git diff --git a/ext/Socket/Socket.xs b/ext/Socket/Socket.xs index 82ed442..cefcb24 100644 --- a/ext/Socket/Socket.xs +++ b/ext/Socket/Socket.xs @@ -711,13 +711,11 @@ inet_aton(host) { struct in_addr ip_address; struct hostent * phe; - int ok; + int ok = inet_aton(host, &ip_address); - if (phe = gethostbyname(host)) { + if (!ok && (phe = gethostbyname(host))) { Copy( phe->h_addr, &ip_address, phe->h_length, char ); ok = 1; - } else { - ok = inet_aton(host, &ip_address); } ST(0) = sv_newmortal();