Truncate MachineName (and UserDomainName) at first period (#9843)
commite1651e85fa3d20a59dd7c59ae4547f89181b7030
authorCalvin <calvin@cmpct.info>
Mon, 20 Aug 2018 15:21:07 +0000 (20 12:21 -0300)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Mon, 20 Aug 2018 15:21:07 +0000 (20 17:21 +0200)
tree6363de5a2ee50518e7cfd1c55a30c24d38d750fa
parent396559769d0e4ca72837e44bcf837b7c91596414
Truncate MachineName (and UserDomainName) at first period (#9843)

* Truncate MachineName (and UserDomainName) at first period

Unix machines often put their FQDN as the host name, and domain
name is used for things such as yp. As such, truncate the FQDN to
just the hostname, as other Unix utilities seem to do.

Matches the .NET Core and .NET Framework behaviour, and MS seems to
require this for a future project. Fixes #9839.

* Add a unit test for bug

* Formatting tweaks
mcs/class/corlib/Test/System/EnvironmentTest.cs
mono/metadata/icall.c