Skip to content

Commit 920c047

Browse files
committed
msg-filter: tweak a regex for cutting NVR
... so that we do not need to remove `/` from the matched group afterwards. No change in behavior intended with this commit. Related: https://issues.redhat.com/browse/OSH-563
1 parent 3f10b25 commit 920c047

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/lib/msg-filter.cc

+3-4
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ struct MsgFilter::Private {
6969
const RE reKrn = RE(strKrn);
7070
const RE reDir = RE("^([^:]*/)");
7171
const RE reFile = RE("[^/]+$");
72-
const RE rePath = RE("^(?:/builddir/build/BUILD/)?([^/]+/)(.*)(\\.[ly])?$");
72+
const RE rePath = RE("^(?:/builddir/build/BUILD/)?([^/]+)/(.*)(\\.[ly])?$");
7373
const RE rePyBuild = RE("^((?:/builddir/build/BUILD/)?[^/]+/)build/lib/(.*)$");
7474
const RE reTmpPath = RE("^(/var)?/tmp/(.*)$");
7575
const RE reTmpCleaner = RE("(.*)");
@@ -279,12 +279,11 @@ std::string MsgFilter::filterPath(const std::string &origPath) const
279279
// no match
280280
return path;
281281

282-
std::string nvr (sm[/* NVR */ 1]);
282+
const std::string nvr = sm[/* NVR */ 1];
283283
path = sm[/* core */ 2];
284284

285285
// try to kill the multiple version strings in paths (kernel, OpenLDAP, ...)
286-
nvr.resize(nvr.size() - 1);
287-
std::string ver(boost::regex_replace(nvr, d->reKrn, ""));
286+
const std::string ver = boost::regex_replace(nvr, d->reKrn, "");
288287
const std::string krnPattern = d->strKrn + ver + "[^/]*/";
289288

290289
#if DEBUG_SUBST > 2

0 commit comments

Comments
 (0)