diff options
author | regnat <rg@regnat.ovh> | 2022-01-25 10:49:27 +0100 |
---|---|---|
committer | regnat <rg@regnat.ovh> | 2022-01-25 10:49:27 +0100 |
commit | f113ea6c739a9f34fc0c79b1857279b9c0803bf1 (patch) | |
tree | af5d18c697f28aaf74e223ebb05cbb88e48d643b /src/libexpr | |
parent | 0a70b37b5694c769fb855c1afe7642407d1db64f (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.y | 2 |
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)); |