diff --git a/atom b/atom index caed8a0..a879217 100755 --- a/atom +++ b/atom @@ -1135,13 +1135,12 @@ getDestDir() { replace=$(sanitizeFile "$disc") destdir="${destdir//%\{disc\}/$replace}" else - destdir+=(sanitizeFile "${filename%%/*}") - part="${filename#*/}/" - while : + destdir+=$(sanitizeFile "${filename%%/*}") + part=${filename#*/} + while [[ $part =~ / ]] do destdir+="/$(sanitizeFile "${part%%/*}")" part=${part#*/} - [ -z "$part" ] && break done fi if ! [ -d "$destdir" ]