From 2f9e00511587f1742fe62182e59f88e3445bd67c Mon Sep 17 00:00:00 2001 From: prozacx Date: Sat, 20 Feb 2010 18:54:52 +0000 Subject: [PATCH] Readding Token() code which does get called a lot but also fixes a webadmin bug where the darkcloud skin doesn't highlite the current page's nav item git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1779 726aef4b-f618-498e-8847-2d620e286838 --- ZNCString.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/ZNCString.cpp b/ZNCString.cpp index ffda177b..cad3a284 100644 --- a/ZNCString.cpp +++ b/ZNCString.cpp @@ -388,6 +388,25 @@ unsigned int CString::Replace(CString& sStr, const CString& sReplace, const CStr CString CString::Token(unsigned int uPos, bool bRest, const CString& sSep, bool bAllowEmpty, const CString& sLeft, const CString& sRight, bool bTrimQuotes) const { + VCString vsTokens; + if (Split(sSep, vsTokens, bAllowEmpty, sLeft, sRight, bTrimQuotes) > uPos) { + CString sRet; + + for (unsigned int a = uPos; a < vsTokens.size(); a++) { + if (a > uPos) { + sRet += sSep; + } + + sRet += vsTokens[a]; + + if (!bRest) { + break; + } + } + + return sRet; + } + const char *sep_str = sSep.c_str(); size_t sep_len = sSep.length(); const char *str = c_str();