From ce1ff7aff5d9d9b904b76915ac6ca24e01a554b2 Mon Sep 17 00:00:00 2001 From: Vincent Riquer Date: Mon, 3 Nov 2025 01:41:21 +0100 Subject: [PATCH] quickfix: createindex: gracefully handle empty channel count, sampling rate, bitdepth --- toys/createindex | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/toys/createindex b/toys/createindex index 5714bea..48a735f 100755 --- a/toys/createindex +++ b/toys/createindex @@ -452,7 +452,10 @@ do expr2='(,|$)' if ! [[ $channelss =~ $expr1"$channels"$expr2 ]] then - if [ -n "$channelss" ] \ + if [[ -n "$channels" ]] + then + : + elif [ -n "$channelss" ] \ && (( channels < ${channelss%%,*} )) then channelss="$channels,$channelss" @@ -462,7 +465,10 @@ do fi if ! [[ $rates =~ $expr1"$rate"$expr2 ]] then - if [ -n "$rates" ] \ + if [[ -n "$rate" ]] + then + : + elif [ -n "$rates" ] \ && (( rate < ${rates%%,*} )) then rates="$rate,$rates" @@ -472,7 +478,10 @@ do fi if [ -n "$depth" ] && ! [[ $depths =~ $expr1"$depth"$expr2 ]] then - if [ -n "$depths" ] \ + if [[ -n "$depth" ]] + then + : + elif [ -n "$depths" ] \ && (( depth < ${depths%%,*} )) then depths="$depth,$depths"