Now accepting screen names that end in a dot since many OS X

users have misconfigured their systems to have hostnames that
end in a dot.
This commit is contained in:
crs 2004-09-28 22:25:35 +00:00
parent f8e133dc29
commit 376bba970b
1 changed files with 12 additions and 0 deletions

View File

@ -315,10 +315,22 @@ CConfig::isValidScreenName(const CString& name) const
// name ::= [_A-Za-z0-9] | [_A-Za-z0-9][-_A-Za-z0-9]*[_A-Za-z0-9]
// domain ::= . name
// validname ::= name domain*
// we also accept names ending in . because many OS X users have
// so misconfigured their systems.
// empty name is invalid
if (name.empty()) {
return false;
}
// check each dot separated part
CString::size_type b = 0;
for (;;) {
// accept trailing .
if (b == name.size()) {
break;
}
// find end of part
CString::size_type e = name.find('.', b);
if (e == CString::npos) {