From 8fd9e1d1b972eaf4ae7bbffed0479902963d575b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 10 Jan 2011 20:26:22 +0200 Subject: [PATCH 1/3] Avoid "bad array subscript" with /usr/bin/python (Debian: #559953). --- completions/python | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 From a2348ba792526071120a4687bc0b31d25553f59a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 10 Jan 2011 20:29:34 +0200 Subject: [PATCH 2/3] Complete "/path/to/python" the same way as plain "python". --- completions/python | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/python b/completions/python index 9218435e..7cbc8c2e 100644 --- a/completions/python +++ b/completions/python @@ -21,7 +21,7 @@ _python() -- "$cur" ) ) return 0 ;; - !(python?([23])|-?)) + !(?(*/)python?([23])|-?)) [[ $COMP_CWORD -lt 2 || ${COMP_WORDS[COMP_CWORD-2]} != -@(Q|W) ]] \ && _filedir ;; From 884307100281c3b5ff3b64130c1fbb9ec306f859 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 10 Jan 2011 20:31:57 +0200 Subject: [PATCH 3/3] Loosen python executable matching glob. --- completions/python | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/python b/completions/python index 7cbc8c2e..17f96f50 100644 --- a/completions/python +++ b/completions/python @@ -21,7 +21,7 @@ _python() -- "$cur" ) ) return 0 ;; - !(?(*/)python?([23])|-?)) + !(?(*/)python*([0-9.])|-?)) [[ $COMP_CWORD -lt 2 || ${COMP_WORDS[COMP_CWORD-2]} != -@(Q|W) ]] \ && _filedir ;;