6868if [[ " $COMSPEC " ]]; then
6969 alias convert=" magick convert" # Shun MS Windows' "convert" command.
7070fi
71-
71+
7272cleanup () {
7373 echo -n $' \e\\ ' # Escape sequence to stop SIXEL.
7474 stty echo # Reset terminal to show characters.
@@ -193,7 +193,7 @@ main() {
193193 readarray -t < <( printf " %s\n" " $@ " | sort)
194194
195195 # Only show first frame of animated GIFs if filename not specified.
196- for x in ${! MAPFILE[@]} ; do
196+ for x in " ${! MAPFILE[@]} " ; do
197197 if [[ ${MAPFILE[$x]} =~ (gif| webp)$ ]]; then
198198 MAPFILE[$x ]=" ${MAPFILE[$x]} [0]"
199199 fi
@@ -205,7 +205,7 @@ main() {
205205 for arg; do
206206 if [ -d " $arg " ]; then
207207 echo Recursing on $arg
208- (cd " $arg " ; $lsix )
208+ (cd " $arg " || exit ; $lsix )
209209 else
210210 nodirs+=(" $arg " )
211211 fi
@@ -215,7 +215,7 @@ main() {
215215
216216
217217 # Resize on load: Save memory by appending this suffix to every filename.
218- resize=" [${tilewidth} x${tileheight} ]"
218+ # resize="[${tilewidth}x${tileheight}]" ### DONE: SC2034 (warning): resize appears unused. Verify use (or export if used externally).
219219
220220 imoptions=" -tile ${numtiles} x1" # Each montage is 1 row x $numtiles columns
221221 imoptions+=" -geometry ${tilewidth} x${tileheight} >+${tilexspace} +${tileyspace} " # Size of each tile and spacing
@@ -234,7 +234,7 @@ main() {
234234 # While we still have images to process...
235235 onerow=()
236236 goal=$(( $# - numtiles)) # How many tiles left after this row
237- while [ $# -gt 0 -a $# -gt $goal ]; do
237+ while [ $# -gt 0 ] && [ $# -gt $goal ]; do
238238 len=${# onerow[@]}
239239 onerow[len++]=" -label"
240240 onerow[len++]=$( processlabel " $1 " )
0 commit comments