aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
diff options
context:
space:
mode:
authorregnat <rg@regnat.ovh>2022-01-25 10:49:27 +0100
committerregnat <rg@regnat.ovh>2022-01-25 10:49:27 +0100
commitf113ea6c739a9f34fc0c79b1857279b9c0803bf1 (patch)
treeaf5d18c697f28aaf74e223ebb05cbb88e48d643b /src/libexpr
parent0a70b37b5694c769fb855c1afe7642407d1db64f (diff)
Fix parsing of variable names that are a suffix of '__curPos'
Follow-up from #5969 Fix #5982
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/parser.y2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y
index 55f8abcb7..7a8e93c12 100644
--- a/src/libexpr/parser.y
+++ b/src/libexpr/parser.y
@@ -405,7 +405,7 @@ expr_select
expr_simple
: ID {
std::string_view s = "__curPos";
- if (strncmp($1.p, s.data(), s.size()) == 0)
+ if ($1.l == s.size() && strncmp($1.p, s.data(), s.size()) == 0)
$$ = new ExprPos(CUR_POS);
else
$$ = new ExprVar(CUR_POS, data->symbols.create($1));