[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-165-g41ce815

Ville Skyttä ville.skytta at iki.fi
Sun May 1 14:35:06 UTC 2011


The following commit has been merged in the master branch:
commit 5c98d3160a7ceb3d68ee7392c6a3307bee419550
Author: Igor Murzov <igor at gplsoft.org>
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



More information about the Bash-completion-commits mailing list