The following commit has been merged in the master branch:
commit 5c98d3160a7ceb3d68ee7392c6a3307bee419550
Author: Igor Murzov <[email protected]>
Date:   Sun May 1 17:32:09 2011 +0300

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

diff --git a/bash_completion b/bash_completion
index b523de5..1337dcb 100644
--- a/bash_completion
+++ b/bash_completion
@@ -737,7 +737,7 @@ _init_completion()
             i=$(( ++i ))
         fi
     done
-    prev=${words[cword-1]}
+    [[ $cword -ge 1 ]] && prev=${words[cword-1]} || prev=
 
     return 0
 }

-- 
bash-completion

_______________________________________________
Bash-completion-commits mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/bash-completion-commits

Reply via email to