1 # $NetBSD: varparse-dynamic.mk,v 1.2 2020/09/13 21:00:34 rillig Exp $
3 # Before 2020-07-27, there was an off-by-one error in Var_Parse that skipped
4 # the last character in the variable name.
5 # To trigger the bug, the variable must not be defined.
6 .if ${.TARGET} # exact match, may be undefined
8 .if ${.TARGEX} # 1 character difference, must be defined
10 .if ${.TARGXX} # 2 characters difference, must be defined
13 # When a dynamic variable (such as .TARGET) is evaluated in the global
14 # context, it is not yet ready to be expanded. Therefore the complete
15 # expression is returned as the variable value, hoping that it can be
16 # resolved at a later point.
18 # This test covers the code in Var_Parse that deals with VAR_JUNK but not
19 # VAR_KEEP for dynamic variables.
20 .if ${.TARGET:S,^,,} != "\${.TARGET:S,^,,}"