Просмотр исходного кода

Improve script portability - 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. See
https://osdn.net/projects/yash/ticket/46041.
Jakub Jirutka 2 лет назад
Родитель
Сommit
436b15c571
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      alpine-make-rootfs

+ 1 - 1
alpine-make-rootfs

@@ -217,7 +217,7 @@ setup_timezone() {
 
 # Unmounts all filesystems under the directory tree $1 (must be absolute path).
 umount_recursively() {
-	local mount_point=$(realpath "$1")
+	local mount_point="$(realpath "$1")"
 
 	cat /proc/mounts \
 		| cut -d ' ' -f 2 \