diff --git a/bash-completion.changes b/bash-completion.changes index f04f40f..f326a4f 100644 --- a/bash-completion.changes +++ b/bash-completion.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Thu Aug 17 12:28:28 UTC 2023 - Dr. Werner Fink + +- Modify patches + * ls-completion-boo889319.patch + * rm-completion-smart-boo958462.patch + to avoid skipping spaces after last word on command line (boo#1210974) +- Add patch fix_quote_readline_by_ref.patch + * Do not escape leading ~ nor backslash and avoid empty quoting + ------------------------------------------------------------------- Sun Apr 2 10:26:09 UTC 2023 - Callum Farmer diff --git a/bash-completion.spec b/bash-completion.spec index 78a3428..6bc6b3f 100644 --- a/bash-completion.spec +++ b/bash-completion.spec @@ -1,7 +1,7 @@ # -# spec file for package bash +# spec file # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -72,6 +72,8 @@ Patch13: boo1190929-9af4afd0.patch Patch14: bsc1199724-modules.patch # PATCH-FIX-UPSTREAM bsc#1200791 Patch15: fix-curl-help-completion-bsc1200791.patch +# PATCH-FIX-SUSE -- avoid broken quotes ands escapes +Patch16: fix_quote_readline_by_ref.patch BuildRequires: libtool BuildRequires: pkgconfig BuildArch: noarch diff --git a/fix_quote_readline_by_ref.patch b/fix_quote_readline_by_ref.patch new file mode 100644 index 0000000..3338bde --- /dev/null +++ b/fix_quote_readline_by_ref.patch @@ -0,0 +1,43 @@ +From: JuanJo Ciarlante +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/739835 +Forwarded: yes, <5328F418.100@canonical.com> + +--- + bash_completion | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +--- a/bash_completion ++++ b/bash_completion 2023-08-17 12:16:26.654187550 +0000 +@@ -542,13 +542,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: + # https://www.mail-archive.com/bash-completion-devel@lists.alioth.debian.org/msg01942.html diff --git a/ls-completion-boo889319.patch b/ls-completion-boo889319.patch index 4045d53..27a1e5a 100644 --- a/ls-completion-boo889319.patch +++ b/ls-completion-boo889319.patch @@ -16,7 +16,7 @@ Index: bash-completion-2.11/bash_completion sed sha{,1,224,256,384,512}sum shar sort split strip sum tac tail tee \ texindex touch tr unexpand uniq vdir wc who complete -F _longopt -o default env netstat seq uname units -+complete -F _longopt -o bashdefault -o default -o filenames -o nospace ls ll la l ls-l lf ++complete -F _longopt -o bashdefault -o default -o filenames ls ll la l ls-l lf declare -Ag _xspecs diff --git a/rm-completion-smart-boo958462.patch b/rm-completion-smart-boo958462.patch index 261b16b..47638ec 100644 --- a/rm-completion-smart-boo958462.patch +++ b/rm-completion-smart-boo958462.patch @@ -11,7 +11,7 @@ Index: bash-completion-2.11/bash_completion =================================================================== --- bash-completion-2.11.orig/bash_completion +++ bash-completion-2.11/bash_completion -@@ -2096,11 +2096,13 @@ _longopt() +@@ -2096,11 +2096,12 @@ _longopt() complete -F _longopt -o filenames a2ps awk base64 bash bc bison cat chroot colordiff cp \ csplit cut date df diff dir du enscript expand fmt fold gperf \ grep grub head irb ld ldd less ln m4 md5sum mkdir mkfifo mknod \ @@ -20,9 +20,8 @@ Index: bash-completion-2.11/bash_completion sed sha{,1,224,256,384,512}sum shar sort split strip sum tac tail tee \ texindex touch tr unexpand uniq vdir wc who complete -F _longopt -o default env netstat seq uname units - complete -F _longopt -o bashdefault -o default -o filenames -o nospace ls ll la l ls-l lf -+complete -F _longopt -o bashdefault -o default -o filenames -o nospace rm rmdir -+ + complete -F _longopt -o bashdefault -o default -o filenames ls ll la l ls-l lf ++complete -F _longopt -o bashdefault -o default -o filenames rm rmdir declare -Ag _xspecs