summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel F. T. Gomes <gabriel@inconstante.eti.br>2019-02-24 18:30:27 -0300
committerGabriel F. T. Gomes <gabriel@inconstante.eti.br>2019-02-24 18:30:27 -0300
commite08bb678f50918df9f3cffa4f10f36c2cfaa59ef (patch)
tree7339464410fa0e7f708bc295cb82c8e66b02f997
parent659dc4e513821bc27adef07cd58647dff55a0405 (diff)
downloadbash-completion-e08bb678f50918df9f3cffa4f10f36c2cfaa59ef.tar.gz
Fix bad array subscript error with commands ending with slash (bug 923167)
This is a backport from upstream
-rw-r--r--debian/changelog2
-rw-r--r--debian/patches/15-bug-923167-fix-bad-array-subscript.patch20
-rw-r--r--debian/patches/series1
3 files changed, 23 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index af8598ed..fa5e887b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,7 @@
bash-completion (1:2.8-6) UNRELEASED; urgency=medium
+ * Fix bad array subscript error with slash. (Closes: #923167)
+
-- Gabriel F. T. Gomes <gabriel@inconstante.eti.br> Fri, 21 Dec 2018 23:22:52 -0200
bash-completion (1:2.8-5) unstable; urgency=medium
diff --git a/debian/patches/15-bug-923167-fix-bad-array-subscript.patch b/debian/patches/15-bug-923167-fix-bad-array-subscript.patch
new file mode 100644
index 00000000..d8bcc9cd
--- /dev/null
+++ b/debian/patches/15-bug-923167-fix-bad-array-subscript.patch
@@ -0,0 +1,20 @@
+commit 583562b9e56207bd428497ceb96df4e1f1f53158
+Author: Ville Skyttä <ville.skytta@iki.fi>
+Date: Sun May 6 21:41:48 2018 +0200
+
+ __load_completion: Avoid bad array subscript on "commands" ending with slash
+
+ Closes #209
+
+diff --git a/bash_completion b/bash_completion
+index 9a9eae0b..442c0757 100644
+--- a/bash_completion
++++ b/bash_completion
+@@ -2019,6 +2019,7 @@ __load_completion()
+ {
+ local -a dirs=( ${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions )
+ local OIFS=$IFS IFS=: dir cmd="${1##*/}" compfile
++ [[ -n $cmd ]] || return 1
+ for dir in ${XDG_DATA_DIRS:-/usr/local/share:/usr/share}; do
+ dirs+=( $dir/bash-completion/completions )
+ done
diff --git a/debian/patches/series b/debian/patches/series
index abd3be2c..517a4f31 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -12,4 +12,5 @@
12-tar-support-completions-for-zstd-compression.patch
13-fix-perl-completions-with-a-space-between-option-and.patch
14-bug-550676-fallback-to-path-completion.patch
+15-bug-923167-fix-bad-array-subscript.patch
99-use-install-data-hook.patch