From: Jakub Skoczen Date: Tue, 7 May 2013 14:45:38 +0000 (+0200) Subject: Fix multiple match aggregation X-Git-Tag: v1.3.59~57^2~16 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=58a90ea3da0cae8b9b198034736cc505e1f8273a;p=metaproxy-moved-to-github.git Fix multiple match aggregation --- diff --git a/src/filter_http_rewrite.cpp b/src/filter_http_rewrite.cpp index ff1a25c..86667ca 100644 --- a/src/filter_http_rewrite.cpp +++ b/src/filter_http_rewrite.cpp @@ -208,14 +208,14 @@ const std::string yf::HttpRewrite::search_replace( } //prepare replacement string std::string rvalue = sub_vars(uri_pat, vars); - //rewrite value - std::string rhvalue = what.prefix().str() - + rvalue + what.suffix().str(); yaz_log(YLOG_LOG, "! Rewritten '%s' to '%s'", what.str(0).c_str(), rvalue.c_str()); - out += rhvalue; + out += std::string(start, what[0].first) + rvalue; start = what[0].second; //move search forward } + //if we had a match cat the last part + if (start != txt.begin()) + out += std::string(start, end); return out; }