[scripts-audit] z_vcpkg_function_arguments (#16193)

* [scripts-audit] z_vcpkg_function_arguments

fix bug when ARGC = 0

* really fix the bug this time
This commit is contained in:
nicole mazzuca 2021-02-12 16:07:46 -08:00 committed by GitHub
parent 6f42659cb9
commit b55a40d895
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,8 +41,10 @@ macro(z_vcpkg_function_arguments OUT_VAR)
set(z_vcpkg_function_arguments_ARGC "${${z_vcpkg_function_arguments_ARGC_NAME}}")
math(EXPR z_vcpkg_function_arguments_LAST_ARG "${z_vcpkg_function_arguments_ARGC} - 1")
if(z_vcpkg_function_arguments_LAST_ARG GREATER_EQUAL z_vcpkg_function_arguments_FIRST_ARG)
foreach(z_vcpkg_function_arguments_N RANGE "${z_vcpkg_function_arguments_FIRST_ARG}" "${z_vcpkg_function_arguments_LAST_ARG}")
string(REPLACE ";" "\\;" z_vcpkg_function_arguments_ESCAPED_ARG "${ARGV${z_vcpkg_function_arguments_N}}")
list(APPEND "${OUT_VAR}" "${z_vcpkg_function_arguments_ESCAPED_ARG}")
endforeach()
endif()
endmacro()