mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-11 15:37:24 +00:00
Funced: Limit damage when removing tmpfile
This will now only forcibly remove _files_, not directories. $tmpdir _should_ be something only we use in /tmp, but mktemp might screw up.
This commit is contained in:
parent
475439fa0b
commit
b9848538e3
1 changed files with 3 additions and 1 deletions
|
@ -124,6 +124,8 @@ function funced --description 'Edit function definition'
|
|||
break
|
||||
end
|
||||
set -l stat $status
|
||||
rm -rf $tmpdir >/dev/null
|
||||
# Only forcibly delete files to limit possible damage is tmpdir is set to something weird
|
||||
rm -f $tmpname >/dev/null
|
||||
rm -r $tmpdir >/dev/null
|
||||
return $stat
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue