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:
parent
f8e133dc29
commit
376bba970b
|
@ -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]
|
// name ::= [_A-Za-z0-9] | [_A-Za-z0-9][-_A-Za-z0-9]*[_A-Za-z0-9]
|
||||||
// domain ::= . name
|
// domain ::= . name
|
||||||
// validname ::= name domain*
|
// 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
|
// check each dot separated part
|
||||||
CString::size_type b = 0;
|
CString::size_type b = 0;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
// accept trailing .
|
||||||
|
if (b == name.size()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// find end of part
|
// find end of part
|
||||||
CString::size_type e = name.find('.', b);
|
CString::size_type e = name.find('.', b);
|
||||||
if (e == CString::npos) {
|
if (e == CString::npos) {
|
||||||
|
|
Loading…
Reference in New Issue