mirror of https://github.com/kiwix/libkiwix.git
+ fix bug in regex insertion (string was inserted in wrong place)
This commit is contained in:
parent
bc8a400fd1
commit
8f89edf17c
|
@ -18,6 +18,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "regexTools.h"
|
#include "regexTools.h"
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
std::map<std::string, RegexMatcher*> regexCache;
|
std::map<std::string, RegexMatcher*> regexCache;
|
||||||
|
|
||||||
|
@ -61,7 +62,7 @@ void appendToFirstOccurence(std::string &content, const std::string regex, cons
|
||||||
|
|
||||||
if (matcher->find()) {
|
if (matcher->find()) {
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
content.insert(matcher->start(status), replacement);
|
content.insert(matcher->end(status), replacement);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue