From 557df8f1a224b406d1fac46a833689481c7c31bd Mon Sep 17 00:00:00 2001 From: Duncan Mac-Vicar P Date: Fri, 10 Aug 2007 14:08:37 +0000 Subject: [PATCH] unify on regex_match(), remove regex_search --- zypp/KeyRing.cc | 2 +- zypp/base/Regex.cc | 8 -------- zypp/base/Regex.h | 1 - 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/zypp/KeyRing.cc b/zypp/KeyRing.cc index 6b02839..1be12e8 100644 --- a/zypp/KeyRing.cc +++ b/zypp/KeyRing.cc @@ -568,7 +568,7 @@ namespace zypp { //MIL << "[" << line << "]" << endl; str::smatch what; - if(str::regex_search(line, what, rxNoKey)) + if(str::regex_match(line, what, rxNoKey)) { if ( what.size() >= 1 ) id = what[1]; diff --git a/zypp/base/Regex.cc b/zypp/base/Regex.cc index 83143d0..33d2af2 100644 --- a/zypp/base/Regex.cc +++ b/zypp/base/Regex.cc @@ -44,14 +44,6 @@ bool zypp::str::regex_match(const std::string& s, const regex& regex) return !regexec(®ex.m_preg, s.c_str(), 0, NULL, 0); } -bool zypp::str::regex_search(const std::string& s, smatch& matches, const regex& regex) -{ - bool r= regex.m_valid && !regexec(®ex.m_preg, s.c_str(), 12, &matches.pmatch[0], 0); - if (r) - matches.match_str = s; - return r; -} - smatch::smatch() { memset(&pmatch, -1, sizeof(pmatch)); diff --git a/zypp/base/Regex.h b/zypp/base/Regex.h index 4c66153..6189fd5 100644 --- a/zypp/base/Regex.h +++ b/zypp/base/Regex.h @@ -61,7 +61,6 @@ namespace zypp bool regex_match(const std::string& s, str::smatch& matches, const regex& regex); bool regex_match(const std::string& s, const regex& regex); - bool regex_search(const std::string& s, str::smatch& matches, const regex& regex); ///////////////////////////////////////////////////////////////// } // namespace str -- 2.7.4