summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Skyttä <ville.skytta@iki.fi>2011-01-10 20:26:22 +0200
committerVille Skyttä <ville.skytta@iki.fi>2011-01-10 20:26:22 +0200
commit8fd9e1d1b972eaf4ae7bbffed0479902963d575b (patch)
tree8ddcec2167c0de8ecec123dc945f927abe495e46
parent5f04a30f7ab561dc99054445a7f635f3df3a0747 (diff)
downloadbash-completion-8fd9e1d1b972eaf4ae7bbffed0479902963d575b.tar.gz
Avoid "bad array subscript" with /usr/bin/python <TAB> (Debian: #559953).
-rw-r--r--completions/python3
1 files changed, 2 insertions, 1 deletions
diff --git a/completions/python b/completions/python
index d6274298..9218435e 100644
--- a/completions/python
+++ b/completions/python
@@ -22,7 +22,8 @@ _python()
return 0
;;
!(python?([23])|-?))
- [[ ${COMP_WORDS[COMP_CWORD-2]} != -@(Q|W) ]] && _filedir
+ [[ $COMP_CWORD -lt 2 || ${COMP_WORDS[COMP_CWORD-2]} != -@(Q|W) ]] \
+ && _filedir
;;
esac