From 58a90ea3da0cae8b9b198034736cc505e1f8273a Mon Sep 17 00:00:00 2001 From: Jakub Skoczen Date: Tue, 7 May 2013 16:45:38 +0200 Subject: [PATCH] Fix multiple match aggregation --- src/filter_http_rewrite.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; } -- 1.7.10.4