mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 14:03:58 +00:00
Fix trap -p
Two different bugs completely broke `trap -p`. First bug broke filtering of
functions with trap handlers (`functions -na` prints functions separated by a
comma, not a new line). Second bug broke showing of function definitions for
traps because a refactor renamed only some call sites but references to `$i`
renamed.
These issues were introduced in a6820cbe
and appear to have been caught just in
time: no released version is affected (changes made post-3.5.1).
This commit is contained in:
parent
040591bc47
commit
c8f92878c3
1 changed files with 2 additions and 2 deletions
|
@ -63,12 +63,12 @@ function trap -d 'Perform an action when the shell receives a signal'
|
|||
if set -q argv[1]
|
||||
set names $argv
|
||||
else
|
||||
set names (functions -na | string match "__trap_handler_*" | string replace '__trap_handler_' '')
|
||||
set names (functions -a | string split ',' | string match "__trap_handler_*" | string replace '__trap_handler_' '')
|
||||
end
|
||||
|
||||
for sig in (string upper -- $names | string replace -r '^SIG' '')
|
||||
if test -n "$sig"
|
||||
functions __trap_handler_$i
|
||||
functions __trap_handler_$sig
|
||||
else
|
||||
return 1
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue