Support tildes when recursively sourcing muttrc files (Debian: #615134).
This commit is contained in:
parent
f0a9128649
commit
1ffb918b4e
1
CHANGES
1
CHANGES
@ -12,6 +12,7 @@ bash-completion (2.x)
|
||||
* Install full path /etc/rc.d/init.d/* completions.
|
||||
* Try both full path and basename completions for sudo etc (Alioth: #313065).
|
||||
* Don't install completions for init.d backup files.
|
||||
* Support tildes when recursively sourcing muttrc files (Debian: #615134).
|
||||
|
||||
[ Guillaume Rousse ]
|
||||
* added puppet completion, using work from Mathieu Parent (sathieudebian.org)
|
||||
|
@ -61,6 +61,7 @@ _muttconffiles()
|
||||
while [[ "$1" ]]; do
|
||||
newconffiles=( $(sed -n 's|^source[[:space:]]\{1,\}\([^[:space:]]\{1,\}\).*$|\1|p' $(eval echo $1) ) )
|
||||
for file in "${newconffiles[@]}"; do
|
||||
__expand_tilde_by_ref file
|
||||
[[ ! -f "$file" || "${sofar/ ${file} / }" != "$sofar" ]] &&
|
||||
continue
|
||||
sofar+=" $file"
|
||||
|
1
test/fixtures/mutt/bar/muttrc_b
vendored
Normal file
1
test/fixtures/mutt/bar/muttrc_b
vendored
Normal file
@ -0,0 +1 @@
|
||||
source ~/foo/muttrc_f
|
0
test/fixtures/mutt/foo/muttrc_f
vendored
Normal file
0
test/fixtures/mutt/foo/muttrc_f
vendored
Normal file
1
test/fixtures/mutt/muttrc
vendored
1
test/fixtures/mutt/muttrc
vendored
@ -1,3 +1,4 @@
|
||||
set folder=.
|
||||
alias a1 a1@example.com
|
||||
alias a2 a2@example.com
|
||||
source ~/bar/muttrc_b
|
||||
|
@ -1,10 +1,15 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
assert_bash_exec {OLDHOME=$HOME ; HOME=$SRCDIRABS/fixtures/mutt}
|
||||
}
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified {/OLDPWD=/d}
|
||||
assert_bash_exec {HOME=$OLDHOME}
|
||||
assert_env_unmodified {
|
||||
/OLDPWD=/d
|
||||
/OLDHOME=/d
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -30,4 +35,9 @@ assert_complete_dir $expected "mutt -F muttrc -A " $::srcdir/fixtures/mutt
|
||||
sync_after_int
|
||||
|
||||
|
||||
set expected "$::srcdirabs/fixtures/mutt/muttrc $::srcdirabs/fixtures/mutt/bar/muttrc_b $::srcdirabs/fixtures/mutt/foo/muttrc_f"
|
||||
assert_bash_list $expected { _muttconffiles "$HOME/muttrc" "$HOME/muttrc" } "find muttrcs recursively"
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
||||
|
Loading…
x
Reference in New Issue
Block a user