_init_completion: Fix out of bounds access to words when cword is 0.

This commit is contained in:
Igor Murzov 2011-05-01 17:32:09 +03:00 committed by Ville Skyttä
parent ddbd28f638
commit 5c98d3160a

View File

@ -737,7 +737,7 @@ _init_completion()
i=$(( ++i ))
fi
done
prev=${words[cword-1]}
[[ $cword -ge 1 ]] && prev=${words[cword-1]} || prev=
return 0
}