Explorar o código

Add workaround for Bash 4.3 being silly

Tianon Gravi %!s(int64=7) %!d(string=hai) anos
pai
achega
f488c55aaf
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  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]}"