Tighten up parsing of if-statement in default template
Require space after if and an ending %} after the condition.
This commit is contained in:
parent
a5b1067e02
commit
e2ed647c2a
1 changed files with 2 additions and 2 deletions
4
yadm
4
yadm
|
@ -413,13 +413,13 @@ function replace_vars() {
|
|||
}
|
||||
}
|
||||
function conditions() {
|
||||
pattern = ifs blank "*("
|
||||
pattern = ifs blank "+("
|
||||
for (label in c) {
|
||||
value = c[label]
|
||||
gsub(/[\\.^$(){}\[\]|*+?]/, "\\\\&", value)
|
||||
pattern = sprintf("%syadm\\.%s" blank "*==" blank "*\"%s\"|", pattern, label, value)
|
||||
}
|
||||
sub(/\|$/,")",pattern)
|
||||
sub(/\|$/, ")" blank "*%}$", pattern)
|
||||
return pattern
|
||||
}
|
||||
EOF
|
||||
|
|
Loading…
Reference in a new issue