corrected a problem in dir_init() w/older bashes

Changed an implicit array reference to DI_OUTPUT to an explicit one.
Also made a potential error message declare its origin.
This commit is contained in:
slakmagik 2010-11-12 03:15:55 +00:00
parent c066f66f9c
commit 23fc2049ca

View file

@ -282,7 +282,7 @@ dir_init() {
DI_OUTPUT+=( "${DI_OUTPUT_LINES[$i]}" )
fi
done
if [[ $DI_OUTPUT ]]; then
if [[ ${DI_OUTPUT[*]} ]]; then
# Keep DI_OUTPUT_LINES and the 'table headers' aligned, too.
cat << EOF
@ -324,7 +324,7 @@ EOF
for ((i=0; i<${#DIR_VARS[*]}; i++)); do
if [ ! -w ${DIR_VARS[$i]} ]; then
echo ${DIR_VARS[$i]} not writable
echo $SCRIPT: ${DIR_VARS[$i]} not writable
ERROR=nowrite
fi
done