wineboot: Don't use ai_canonname for ComputerName if it is "localhost".

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jinoh Kang 2022-01-14 16:10:42 +09:00 committed by Alexandre Julliard
parent f7668a85d1
commit ca5a6d07dc
1 changed files with 3 additions and 1 deletions

View File

@ -826,7 +826,9 @@ static void create_computer_name_keys(void)
if (gethostname( buffer, sizeof(buffer) )) return; if (gethostname( buffer, sizeof(buffer) )) return;
hints.ai_flags = AI_CANONNAME; hints.ai_flags = AI_CANONNAME;
if (!getaddrinfo( buffer, NULL, &hints, &res )) name = res->ai_canonname; if (!getaddrinfo( buffer, NULL, &hints, &res ) &&
res->ai_canonname && strcasecmp(res->ai_canonname, "localhost") != 0)
name = res->ai_canonname;
dot = strchr( name, '.' ); dot = strchr( name, '.' );
if (dot) *dot++ = 0; if (dot) *dot++ = 0;
else dot = name + strlen(name); else dot = name + strlen(name);