Package: bash-completion
Version: 1:1.3-1
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: origin-ubuntu natty ubuntu-patch



*** /tmp/tmpiebbIm
I've submitted this patch to Ubuntu as well. The original bug report is 
available here:

https://launchpad.net/bugs/533985

The idea is simply that if the filename whitelist passed to _filedir
fails to produce any results, its more useful to the user to fall
back to unfiltered results than give them nothing. This makes the bash
completion more adaptable as programs change underneath them, and solves
the issue where a program like sqlite3 doesn't actually care at all about
extensions and the general conventions used have just been encoded in
the bash completion.


  * Drop whitelists if they fail to produce any results (LP: #533985)


Thanks for considering the patch.


-- System Information:
Debian Release: squeeze/sid
  APT prefers natty-updates
  APT policy: (500, 'natty-updates'), (500, 'natty-security'), (500, 'natty')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.38-6-generic (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -Nru bash-completion-1.3/debian/changelog bash-completion-1.3/debian/changelog
diff -Nru bash-completion-1.3/debian/patches/disable-whitelist-on-fail.patch bash-completion-1.3/debian/patches/disable-whitelist-on-fail.patch
--- bash-completion-1.3/debian/patches/disable-whitelist-on-fail.patch	1969-12-31 16:00:00.000000000 -0800
+++ bash-completion-1.3/debian/patches/disable-whitelist-on-fail.patch	2011-03-20 06:00:50.000000000 -0700
@@ -0,0 +1,20 @@
+Author: Clint Byrum <[email protected]>
+Subject: disable whitelists when they fail to produce results
+Bug-Ubuntu: https://launchpad.net/bugs/533985
+
+Index: bash-completion-1.3/bash_completion
+===================================================================
+--- bash-completion-1.3.orig/bash_completion	2011-03-20 05:36:36.717277995 -0700
++++ bash-completion-1.3/bash_completion	2011-03-20 05:56:15.748086091 -0700
+@@ -661,6 +661,11 @@
+     fi
+     [ ${#toks[@]} -ne 0 ] && _compopt_o_filenames
+ 
++    # If the filter failed to produce anything, try w/o it (LP: #533985)
++    if [[ -n "$1" ]] && [[ "$1" != -d ]] && [[ ${#toks[@]} -lt 1 ]] ; then
++       toks=( ${toks[@]-} $( compgen -f -X -- $quoted) )
++    fi
++
+     COMPREPLY=( "${COMPREPLY[@]}" "${toks[@]}" )
+ } # _filedir()
+ 
diff -Nru bash-completion-1.3/debian/patches/series bash-completion-1.3/debian/patches/series
--- bash-completion-1.3/debian/patches/series	2011-02-08 06:52:30.000000000 -0800
+++ bash-completion-1.3/debian/patches/series	2011-03-20 05:36:29.000000000 -0700
@@ -1,2 +1,3 @@
 disable-avahi-browse.diff
 apt-get-changelog.patch
+disable-whitelist-on-fail.patch
_______________________________________________
Bash-completion-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/bash-completion-devel

Reply via email to