From 74c85f2c45b8207d4aa4b80a97f4c298ede28b56 Mon Sep 17 00:00:00 2001 From: w00t Date: Sun, 13 May 2007 18:08:37 +0000 Subject: Move IsIdent() into helperfuncs.cpp along with IsNick/IsChannel. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7016 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/helperfuncs.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/helperfuncs.cpp') diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 3f0b5ff0c..6e5f616bd 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -405,6 +405,30 @@ bool InspIRCd::IsNick(const char* n) return (p < NICKMAX - 1); } + +bool InspIRCd::IsIdent(const char* n) +{ + if (!n || !*n) + return false; + + for (char* i = (char*)n; *i; i++) + { + if ((*i >= 'A') && (*i <= '}')) + { + continue; + } + + if (((*i >= '0') && (*i <= '9')) || (*i == '-') || (*i == '.')) + { + continue; + } + + return false; + } + + return true; +} + void InspIRCd::OpenLog(char** argv, int argc) { Config->MyDir = ServerConfig::GetFullProgDir(argv,argc); -- cgit v1.3.1-10-gc9f91