diff --git a/src/cdm b/src/cdm index 813ea69..b0fcf84 100755 --- a/src/cdm +++ b/src/cdm @@ -70,22 +70,22 @@ fi # Default options. -binlist=${binlist:-()} -namelist=${namelist:-()} -flaglist=${flaglist:-()} +[[ -z "${binlist[*]}" ]] && binlist=() +[[ -z "${namelist[*]}" ]] && namelist=() +[[ -z "${flaglist[*]}" ]] && flaglist=() dialogrc=${dialogrc:-} countfrom=${countfrom:-0} display=${display:-0} xtty=${xtty:-7} locktty=${locktty:-no} -serverargs=${serverargs:-'-nolisten tcp'} consolekit=${consolekit:-yes} cktimeout=${cktimeout:-30} +serverargs=${serverargs:-'-nolisten tcp'} # Offer all available sessions in /etc/X11/Sessions, # if binlist if not explicitly set in cdmrc. -if [[ "$binlist" == "()" ]]; then +if [[ "${#binlist[@]}" == 0 ]]; then binlist=($(find /etc/X11/Sessions -maxdepth 1 -type f)) for ((i=0; i<${#binlist[@]}; i++)); do declare flaglist[$i]="X"