瀏覽代碼

Add workaround for Bash 4.3 being silly

Tianon Gravi 7 年之前
父節點
當前提交
f488c55aaf
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      naughty-from.sh

+ 2 - 1
naughty-from.sh

@@ -64,7 +64,8 @@ for img in $tags; do
 	done
 done
 
-for naughtyFrom in "${naughtyFroms[@]}"; do
+for naughtyFrom in "${naughtyFroms[@]:-}"; do
+	[ -n "$naughtyFrom" ] || continue # https://mywiki.wooledge.org/BashFAQ/112#BashFAQ.2F112.line-8 (empty array + "set -u" + bash 4.3 == sad day)
 	img="${naughtyFrom%%=*}"
 	from="${naughtyFrom#$img=}"
 	arches="${naughtyFromsArches[$naughtyFrom]}"