Protect filenames with spaces within tar files.

This commit is contained in:
Ville Skyttä 2010-11-01 19:21:55 +02:00
parent a58697d154
commit 494c44f5a3
2 changed files with 3 additions and 2 deletions

View File

@ -15,7 +15,7 @@ bash-completion (2.x)
*.awb, and *.iso (Alioth: #311420) to mplayer filename completions. *.awb, and *.iso (Alioth: #311420) to mplayer filename completions.
* Add "short" tarball extensions to unxz, unlzma etc completions. * Add "short" tarball extensions to unxz, unlzma etc completions.
* Improve /etc/init.d/*, ipmitool, jar, javadoc, man, mencoder, mkdir, * Improve /etc/init.d/*, ipmitool, jar, javadoc, man, mencoder, mkdir,
mplayer, povray, rpmbuild, sqlite3, wodim, and general help parsing mplayer, povray, rpmbuild, sqlite3, tar, wodim, and general help parsing
completions. completions.
* Fix p4 and povray completions (Alioth: #312625). * Fix p4 and povray completions (Alioth: #312625).
* Add *.xsd, *.xsl, *.rng, and *.wsdl to xmllint filename completions. * Add *.xsd, *.xsl, *.rng, and *.wsdl to xmllint filename completions.

View File

@ -48,7 +48,8 @@ _tar()
# devise how to untar and list it # devise how to untar and list it
untar=t${COMP_WORDS[1]//[^Izjyf]/} untar=t${COMP_WORDS[1]//[^Izjyf]/}
COMPREPLY=( $( compgen -W "$( printf '%s ' $( tar $untar $tar \ local IFS=$'\n'
COMPREPLY=( $( compgen -W "$( printf '%s\n' $( tar $untar $tar \
2>/dev/null ) )" -- "$cur" ) ) 2>/dev/null ) )" -- "$cur" ) )
return 0 return 0
fi fi