Skip to content

Commit de85a20

Browse files
57300jhedberg
authored andcommitted
cmake: extensions: Robustify dt_node_has_status
Calling this function with an output variable named `var` or `okay` could produce an incorrect result, due to the variable being mishandled. Add simple changes to avoid this. Signed-off-by: Grzegorz Swiderski <[email protected]>
1 parent 28eb479 commit de85a20

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cmake/modules/extensions.cmake

+4-4
Original file line numberDiff line numberDiff line change
@@ -3267,13 +3267,13 @@ function(dt_node_has_status var)
32673267
return()
32683268
endif()
32693269

3270-
dt_prop(${var} PATH ${canonical} PROPERTY status)
3270+
dt_prop(status PATH ${canonical} PROPERTY status)
32713271

3272-
if(NOT DEFINED ${var} OR "${${var}}" STREQUAL ok)
3273-
set(${var} okay)
3272+
if(NOT DEFINED status OR status STREQUAL "ok")
3273+
set(status "okay")
32743274
endif()
32753275

3276-
if(${var} STREQUAL ${DT_NODE_STATUS})
3276+
if(status STREQUAL "${DT_NODE_STATUS}")
32773277
set(${var} TRUE PARENT_SCOPE)
32783278
else()
32793279
set(${var} FALSE PARENT_SCOPE)

0 commit comments

Comments
 (0)