Commit 742c2344 authored by Robert Pluim's avatar Robert Pluim

Don't check unibyte hostnames for pure-ASCII

* src/process.c (network_lookup_address_info_1): Only check multibyte
hostnames for pure-ASCII.

* test/src/process-tests.el (unibyte-domain-name): Test unibyte domain
names with network-lookup-address-info.
parent 93638b06
Pipeline #16 failed with stage
......@@ -4537,7 +4537,7 @@ network_lookup_address_info_1 (Lisp_Object host, const char *service,
Lisp_Object msg = Qt;
int ret;
if (SBYTES (host) != SCHARS (host))
if (STRING_MULTIBYTE (host) && SBYTES (host) != SCHARS (host))
error ("Non-ASCII hostname %s detected, please use puny-encode-domain",
SSDATA (host));
ret = getaddrinfo (SSDATA (host), service, hints, res);
......
......@@ -227,6 +227,10 @@
(should-error (network-lookup-address-info "faß.de"))
(should (length (network-lookup-address-info (puny-encode-domain "faß.de")))))
(ert-deftest unibyte-domain-name ()
"Unibyte domain names should work"
(should (length (network-lookup-address-info (string-to-unibyte "google.com")))))
(ert-deftest lookup-google ()
"Check that we can look up google IP addresses"
(let ((addresses-both (network-lookup-address-info "google.com"))
......
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