Do not overwrite interval index when parsing DOM reference

- Closes #390

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
Thomas Lauf 2020-10-01 08:34:44 +02:00
parent d90eab17a0
commit 5b1deaab59
2 changed files with 6 additions and 4 deletions

View file

@ -1,6 +1,8 @@
- #379 CmdSummary: Fix calculation of display start in summary table - #379 CmdSummary: Fix calculation of display start in summary table
(thanks to Shaun Ruffell) (thanks to Shaun Ruffell)
- #390 dom.tracked.X.tag.Y always returns dom.tracked.1.tag.Y
(thanks to pweaver2019)
------ current release --------------------------- ------ current release ---------------------------

View file

@ -196,18 +196,18 @@ bool domGet (
return true; return true;
} }
int n; int m;
// dom.tracked.<N>.tag.<M> // dom.tracked.<N>.tag.<M>
if (pig.skipLiteral ("tag.") && if (pig.skipLiteral ("tag.") &&
pig.getDigits (n)) pig.getDigits (m))
{ {
std::vector <std::string> tags; std::vector <std::string> tags;
for (auto& tag : tracked[count - n].tags ()) for (auto& tag : tracked[count - n].tags ())
tags.push_back (tag); tags.push_back (tag);
if (n <= static_cast <int> (tags.size ())) if (m <= static_cast <int> (tags.size ()))
{ {
value = format ("{1}", tags[n - 1]); value = format ("{1}", tags[m - 1]);
return true; return true;
} }
} }