From 376bba970b7bdb9ee93733958aaf03ef0028c71c Mon Sep 17 00:00:00 2001 From: crs Date: Tue, 28 Sep 2004 22:25:35 +0000 Subject: [PATCH] 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. --- lib/server/CConfig.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/server/CConfig.cpp b/lib/server/CConfig.cpp index 1598854f..dddd2586 100644 --- a/lib/server/CConfig.cpp +++ b/lib/server/CConfig.cpp @@ -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) {