diff options
author | Fabian Homborg <FHomborg@gmail.com> | 2016-05-24 13:50:04 +0200 |
---|---|---|
committer | Fabian Homborg <FHomborg@gmail.com> | 2016-05-24 13:55:09 +0200 |
commit | b9848538e37e8176af9029cfe225bddcf93a6c85 (patch) | |
tree | 64469123f6f9fc227befc126125f24faf60d1133 /share | |
parent | 475439fa0b934b1add793f9584a706b607e35986 (diff) |
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.
Diffstat (limited to 'share')
-rw-r--r-- | share/functions/funced.fish | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/share/functions/funced.fish b/share/functions/funced.fish index 8f62e96b..14cb0d70 100644 --- a/share/functions/funced.fish +++ b/share/functions/funced.fish @@ -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 |