Commit 6bddfc97 authored by Glenn Morris's avatar Glenn Morris

(Frename_file): Avoid copying to trash if a rename involves a delete. (Bug#964).

parent 3102b342
2008-09-20 Glenn Morris <rgm@gnu.org>
* fileio.c (Frename_file): Avoid copying to trash if a rename involves
a delete. (Bug#964).
2008-09-20 Eli Zaretskii <eliz@gnu.org> 2008-09-20 Eli Zaretskii <eliz@gnu.org>
* keyboard.c (Fset_quit_char, Fset_input_meta_mode) * keyboard.c (Fset_quit_char, Fset_input_meta_mode)
......
...@@ -2231,6 +2231,7 @@ This is what happens in interactive use with M-x. */) ...@@ -2231,6 +2231,7 @@ This is what happens in interactive use with M-x. */)
{ {
if (errno == EXDEV) if (errno == EXDEV)
{ {
int count;
#ifdef S_IFLNK #ifdef S_IFLNK
symlink_target = Ffile_symlink_p (file); symlink_target = Ffile_symlink_p (file);
if (! NILP (symlink_target)) if (! NILP (symlink_target))
...@@ -2244,7 +2245,10 @@ This is what happens in interactive use with M-x. */) ...@@ -2244,7 +2245,10 @@ This is what happens in interactive use with M-x. */)
NILP (ok_if_already_exists) ? Qnil : Qt, NILP (ok_if_already_exists) ? Qnil : Qt,
Qt, Qt); Qt, Qt);
count = SPECPDL_INDEX ();
specbind (intern ("delete-by-moving-to-trash"), Qnil);
Fdelete_file (file); Fdelete_file (file);
unbind_to (count, Qnil);
} }
else else
report_file_error ("Renaming", list2 (file, newname)); report_file_error ("Renaming", list2 (file, newname));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment