[Bash-completion-commits] [debian] 01/19: fix_quote_readline_by_ref.patch, thanks to JuanJo Ciarlante (Closes: #739835)
David Paleino
dapal at debian.org
Wed Mar 19 10:51:45 UTC 2014
This is an automated email from the git hooks/post-receive script.
dapal pushed a commit to branch master
in repository debian.
commit d734ca3bd73ae49b8f452802fb8fb65a440ab07a
Author: David Paleino <dapal at debian.org>
Date: Wed Mar 19 10:20:35 2014 +0100
fix_quote_readline_by_ref.patch, thanks to JuanJo Ciarlante (Closes: #739835)
+ avoid escaping 1st '~' (LP: #1288314)
+ avoid quoting if empty, else expansion without args only shows
dirs (LP: #1288031)
+ replace double escaping to single (eg for completing file/paths
with spaces)
---
debian/changelog | 13 +++++++
debian/patches/00-fix_quote_readline_by_ref.patch | 43 +++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 57 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 2f10e9e..f6e2b89 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,16 @@
+bash-completion (1:2.1-3) UNRELEASED; urgency=medium
+
+ * Import patch from Ubuntu:
+ - fix_quote_readline_by_ref.patch, thanks to JuanJo Ciarlante
+ (Closes: #739835):
+ + avoid escaping 1st '~' (LP: #1288314)
+ + avoid quoting if empty, else expansion without args only shows
+ dirs (LP: #1288031)
+ + replace double escaping to single (eg for completing file/paths
+ with spaces)
+
+ -- David Paleino <dapal at debian.org> Wed, 19 Mar 2014 10:14:24 +0100
+
bash-completion (1:2.1-2) unstable; urgency=low
* Don't install nmcli completion (Closes: #728742).
diff --git a/debian/patches/00-fix_quote_readline_by_ref.patch b/debian/patches/00-fix_quote_readline_by_ref.patch
new file mode 100644
index 0000000..6dcdeac
--- /dev/null
+++ b/debian/patches/00-fix_quote_readline_by_ref.patch
@@ -0,0 +1,43 @@
+From: JuanJo Ciarlante <jjo at canonical.com>
+Subject: fix _quote_readline_by_ref to:
+ - avoid escaping 1st '~' (lp: #1288314)
+ - avoid quoting if empty, else expansion without args only shows dirs
+ (lp: #1288031)
+ - replace double escaping to single (eg for completing file/paths with
+ spaces)
+Origin: vendor, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=739835
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=739835
+Forwarded: yes, <5328F418.100 at canonical.com>
+
+---
+ bash_completion | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+--- bash-completion.orig/bash_completion
++++ bash-completion/bash_completion
+@@ -536,13 +536,24 @@ __ltrim_colon_completions()
+ # @param $2 Name of variable to return result to
+ _quote_readline_by_ref()
+ {
+- if [[ $1 == \'* ]]; then
++ if [ -z "$1" ]; then
++ # avoid quoting if empty
++ printf -v $2 %s "$1"
++ elif [[ $1 == \'* ]]; then
+ # Leave out first character
+ printf -v $2 %s "${1:1}"
++ elif [[ $1 == ~* ]]; then
++ # avoid escaping first ~
++ printf -v $2 ~%q "${1:1}"
+ else
+ printf -v $2 %q "$1"
+ fi
+
++ # Replace double escaping ( \\ ) by single ( \ )
++ # This happens always when argument is already escaped at cmdline,
++ # and passed to this function as e.g.: file\ with\ spaces
++ [[ ${!2} == *\\* ]] && printf -v $2 %s "${1//\\\\/\\}"
++
+ # If result becomes quoted like this: $'string', re-evaluate in order to
+ # drop the additional quoting. See also: http://www.mail-archive.com/
+ # bash-completion-devel at lists.alioth.debian.org/msg01942.html
diff --git a/debian/patches/series b/debian/patches/series
index e69de29..38efe9d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -0,0 +1 @@
+00-fix_quote_readline_by_ref.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/bash-completion/debian.git
More information about the Bash-completion-commits
mailing list