projects
/
metaproxy-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1933e49
)
Fix multiple match aggregation
author
Jakub Skoczen
<jakub@indexdata.dk>
Tue, 7 May 2013 14:45:38 +0000
(16:45 +0200)
committer
Jakub Skoczen
<jakub@indexdata.dk>
Tue, 7 May 2013 14:45:38 +0000
(16:45 +0200)
src/filter_http_rewrite.cpp
patch
|
blob
|
history
diff --git
a/src/filter_http_rewrite.cpp
b/src/filter_http_rewrite.cpp
index
ff1a25c
..
86667ca
100644
(file)
--- 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);
}
//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());
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
}
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;
}
return out;
}