Merge pull request #13 from lahwaacz/master

Fixed bug in handling the default value of 'binlist' array
This commit is contained in:
Ghost1227 2012-11-07 07:55:06 -08:00
commit 89429799eb

10
src/cdm
View File

@ -85,10 +85,12 @@ cktimeout=${cktimeout:-30}
# Offer all available sessions in /etc/X11/Sessions,
# if binlist if not explicitly set in cdmrc.
if [[ "${#binlist[@]}" == 0 ]]; then
binlist=($(ls /etc/X11/Sessions))
flaglist=($(sed 's/[[:digit:]]\+/X/g' <<< ${!flaglist[*]}))
namelist=(${binlist[@]^})
if [[ "$binlist" == "()" ]]; then
binlist=($(find /etc/X11/Sessions -maxdepth 1 -type f))
for ((i=0; i<${#binlist[@]}; i++)); do
declare flaglist[$i]="X"
declare namelist[$i]=$(basename ${binlist[$i]})
done
fi
# Generate the main menu.