Allow hostnames to start with a number.

This commit is contained in:
Kyle Mestery
2013-07-24 13:11:58 +01:00
committed by Simon Kelley
parent b4b9308079
commit d859ca2f9b
2 changed files with 7 additions and 5 deletions

View File

@@ -151,14 +151,13 @@ int legal_hostname(char *name)
/* check for legal char a-z A-Z 0-9 - _ . */
{
if ((c >= 'A' && c <= 'Z') ||
(c >= 'a' && c <= 'z'))
(c >= 'a' && c <= 'z') ||
(c >= '0' && c <= '9'))
continue;
if (!first &&
((c >= '0' && c <= '9') ||
c == '-' || c == '_'))
if (!first && (c == '-' || c == '_'))
continue;
/* end of hostname part */
if (c == '.')
return 1;