From 554f5035a0f03e73d53d3ce2eeeee7fa7d287fd2 Mon Sep 17 00:00:00 2001 From: kelson42 Date: Thu, 22 Dec 2011 11:25:24 +0000 Subject: [PATCH] + move appendToFirstOccurence() to regexTools.cpp and use now ICU as regex engine --- src/server/kiwix-serve.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/server/kiwix-serve.cpp b/src/server/kiwix-serve.cpp index fe5d213..b6e89ae 100644 --- a/src/server/kiwix-serve.cpp +++ b/src/server/kiwix-serve.cpp @@ -44,11 +44,11 @@ typedef int off_t; #include #include #include -#include #include #include #include #include +#include using namespace std; @@ -178,19 +178,6 @@ static pthread_mutex_t searcherLock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t compressorLock = PTHREAD_MUTEX_INITIALIZER; static bool hasSearchIndex = false; -static void appendToFirstOccurence(string &content, const string regex, const string &replacement) { - regmatch_t matchs[1]; - regex_t regexp; - - regcomp(®exp, regex.data(), REG_ICASE); - if (!regexec(®exp, content.data(), 1, matchs, 0)) { - if (matchs[0].rm_so > 0) - content.insert(matchs[0].rm_eo, replacement); - } - - regfree(®exp); -} - /* For compression */ #define COMPRESSOR_BUFFER_SIZE 5000000 static Bytef *compr = (Bytef *)malloc(COMPRESSOR_BUFFER_SIZE);