aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Fabian Homborg <FHomborg@gmail.com>2016-05-28 12:34:04 +0200
committerGravatar Fabian Homborg <FHomborg@gmail.com>2016-05-28 12:34:04 +0200
commitd79a5a315256193aef880b1f862aed677eb93c18 (patch)
tree07266ae9f0f5a0508b22949296ec113422c517c9
parentffcfe73299ee384b437cf77a64ae07124583dd52 (diff)
Funced: Make removal safer, take two
Now we try to remove the file and then the directory, without forcing anything, showing any (quite unexpected) error to the user, once.
-rw-r--r--share/functions/funced.fish5
1 files changed, 2 insertions, 3 deletions
diff --git a/share/functions/funced.fish b/share/functions/funced.fish
index 14cb0d70..fd3060a7 100644
--- a/share/functions/funced.fish
+++ b/share/functions/funced.fish
@@ -124,8 +124,7 @@ function funced --description 'Edit function definition'
break
end
set -l stat $status
- # 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
+ rm $tmpname >/dev/null
+ and rmdir $tmpdir >/dev/null
return $stat
end