From 462826ff1fc387dc642f1670a68cddc6f0b6cc29 Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Sun, 6 Nov 2022 20:07:59 +0100 Subject: always quote vars in 'local' assignment Some shells may apply word splitting after expanding variable in `local a=$1`. I know just about yash, but since `local` is supposed to be a builtin *command*, the "correct" behaviour of common shells is actually a special case for `local` - it doesn't apply for other commands. See https://osdn.net/projects/yash/ticket/46041. --- dasd-functions.sh.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'dasd-functions.sh.in') diff --git a/dasd-functions.sh.in b/dasd-functions.sh.in index e71f098..24d7d90 100644 --- a/dasd-functions.sh.in +++ b/dasd-functions.sh.in @@ -87,7 +87,7 @@ is_dasd() { setup_zipl() { local mnt="$1" root="$2" modules="$3" kernel_opts="$4" local parameters="root=$root modules=$modules $kernel_opts" - local dasd=$(echo $eckd_dasd $fba_dasd | tr ' ' ',') + local dasd="$(echo $eckd_dasd $fba_dasd | tr ' ' ',')" local s390x_net="$(get_bootopt s390x_net)" [ -n "$dasd" ] && parameters="$parameters dasd=$dasd" [ -n "$s390x_net" ] && parameters="$parameters s390x_net=$s390x_net" @@ -108,7 +108,7 @@ setup_zipl() { setup_partitions_eckd() { local blocks_per_track=12 tracks_per_cylinder=15 boot_track= swap_track= - local diskdev=$1 boot_size=$2 swap_size=$3 sys_type=$4 + local diskdev="$1" boot_size="$2" swap_size="$3" sys_type="$4" boot_track=$(($boot_size * 1024 / 4 / blocks_per_track)) [ "$swap_size" != 0 ] && swap_track=$(($swap_size * 1024 / 4 / blocks_per_track + boot_track + 1)) local conf="$(mktemp)" -- cgit v1.2.3