diff options
author | Andreas Oberritter <obi@opendreambox.org> | 2016-11-14 12:42:15 +0100 |
---|---|---|
committer | Andreas Oberritter <obi@opendreambox.org> | 2017-06-26 22:57:17 +0200 |
commit | 93d8948be252570223b8cecb20e062f4e2f6bf85 (patch) | |
tree | 998c564ae2c590a0c814d7edd72b2c79dfc09834 | |
parent | 209c1074b8975d247f58825b02e98db919193f77 (diff) | |
download | openembedded-core-contrib-93d8948be252570223b8cecb20e062f4e2f6bf85.tar.gz |
bash-completion: backport fix for frequent error message when pressing tab
Pressing the tab key on an empty line triggered an error message:
| bash: words: bad array subscript
Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
-rw-r--r-- | meta/recipes-support/bash-completion/bash-completion-2.1/0001-_init_completion-Handle-cword-0-LP-1289597.patch | 28 | ||||
-rw-r--r-- | meta/recipes-support/bash-completion/bash-completion_2.1.bb | 3 |
2 files changed, 30 insertions, 1 deletions
diff --git a/meta/recipes-support/bash-completion/bash-completion-2.1/0001-_init_completion-Handle-cword-0-LP-1289597.patch b/meta/recipes-support/bash-completion/bash-completion-2.1/0001-_init_completion-Handle-cword-0-LP-1289597.patch new file mode 100644 index 0000000000..8721bd03f6 --- /dev/null +++ b/meta/recipes-support/bash-completion/bash-completion-2.1/0001-_init_completion-Handle-cword-0-LP-1289597.patch @@ -0,0 +1,28 @@ +Upstream-Status: Backport [from 2.2] + +Signed-off-by: Andreas Oberritter <obi@opendreambox.org> + +From a9c556ccad819869a6a5d932aac0a75a99372f08 Mon Sep 17 00:00:00 2001 +From: Barry Warsaw <barry@python.org> +Date: Wed, 17 Sep 2014 19:32:43 +0300 +Subject: [PATCH] _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. +--- + bash_completion | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +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 diff --git a/meta/recipes-support/bash-completion/bash-completion_2.1.bb b/meta/recipes-support/bash-completion/bash-completion_2.1.bb index 8b257d2d10..5c155c2827 100644 --- a/meta/recipes-support/bash-completion/bash-completion_2.1.bb +++ b/meta/recipes-support/bash-completion/bash-completion_2.1.bb @@ -7,7 +7,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" SECTION = "console/utils" -SRC_URI="http://bash-completion.alioth.debian.org/files/${BPN}-${PV}.tar.bz2" +SRC_URI = "http://bash-completion.alioth.debian.org/files/${BPN}-${PV}.tar.bz2 \ + file://0001-_init_completion-Handle-cword-0-LP-1289597.patch" SRC_URI[md5sum] = "4e2a9f11a4042a38ee79ddcd048e8b9e" SRC_URI[sha256sum] = "2b606804a7d5f823380a882e0f7b6c8a37b0e768e72c3d4107c51fbe8a46ae4f" |