3
0
Fork 0
forked from mirrors/nixpkgs

bash-completion: fix bad array subscript error. Closes #6117

This commit is contained in:
Ivan Sorokin 2015-02-12 22:18:17 +03:00
parent 41cca7d2d6
commit 20ab4027da
2 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,22 @@
commit a9c556ccad819869a6a5d932aac0a75a99372f08
Author: Barry Warsaw <barry@python.org>
Date: Wed Sep 17 19:32:43 2014 +0300
_init_completion: Handle cword < 0 (LP: #1289597)
Previously only bash 4.3 seemed to provoke this, but now with the
empty command consistency tweak it occurs with earlier as well.
diff --git a/bash_completion b/bash_completion
index 7e01ae4..3bb4bc2 100644
--- a/bash_completion
+++ b/bash_completion
@@ -727,7 +727,7 @@ _init_completion()
fi
done
- [[ $cword -eq 0 ]] && return 1
+ [[ $cword -le 0 ]] && return 1
prev=${words[cword-1]}
[[ ${split-} ]] && _split_longopt && split=true

View file

@ -8,6 +8,8 @@ stdenv.mkDerivation rec {
sha256 = "0kxf8s5bw7y50x0ksb77d3kv0dwadixhybl818w27y6mlw26hq1b";
};
patches = [ ./bash-4.3.patch ];
doCheck = true;
meta = {