From 4d8796a59cca0573fd5f38391452d8a3429191d6 Mon Sep 17 00:00:00 2001 From: James Zern Date: Wed, 27 Apr 2016 20:26:49 -0700 Subject: [PATCH] msvs_common.sh: make fix_file_list generic take an array name as the first parameter and operate on the reference; removes a TODO Change-Id: I9d63a31d7a7625123f0d64f212b4e702813cc01b --- build/make/gen_msvs_proj.sh | 2 +- build/make/gen_msvs_vcxproj.sh | 2 +- build/make/msvs_common.sh | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/build/make/gen_msvs_proj.sh b/build/make/gen_msvs_proj.sh index 0cf335b3d..2b91fbfbc 100755 --- a/build/make/gen_msvs_proj.sh +++ b/build/make/gen_msvs_proj.sh @@ -193,7 +193,7 @@ for opt in "$@"; do done # Make one call to fix_path for file_list to improve performance. -fix_file_list +fix_file_list file_list outfile=${outfile:-/dev/stdout} guid=${guid:-`generate_uuid`} diff --git a/build/make/gen_msvs_vcxproj.sh b/build/make/gen_msvs_vcxproj.sh index 182ea28fa..e98611d10 100755 --- a/build/make/gen_msvs_vcxproj.sh +++ b/build/make/gen_msvs_vcxproj.sh @@ -211,7 +211,7 @@ for opt in "$@"; do done # Make one call to fix_path for file_list to improve performance. -fix_file_list +fix_file_list file_list outfile=${outfile:-/dev/stdout} guid=${guid:-`generate_uuid`} diff --git a/build/make/msvs_common.sh b/build/make/msvs_common.sh index 90c14888c..88f1cf9b5 100644 --- a/build/make/msvs_common.sh +++ b/build/make/msvs_common.sh @@ -39,11 +39,12 @@ fix_path() { } # Corrects the paths in file_list in one pass for efficiency. +# $1 is the name of the array to be modified. fix_file_list() { - # TODO(jzern): this could be more generic and take the array as a param. - files=$(fix_path "${file_list[@]}") + declare -n array_ref=$1 + files=$(fix_path "${array_ref[@]}") local IFS=$'\n' - file_list=($files) + array_ref=($files) } generate_uuid() {