Index: emacs/src/fileio.c
diff -c emacs/src/fileio.c:1.544 emacs/src/fileio.c:1.545
*** emacs/src/fileio.c:1.544 Tue May 31 21:54:43 2005
--- emacs/src/fileio.c Thu Jun 23 21:29:26 2005
***************
*** 2775,2780 ****
--- 2775,2781 ----
{
if (errno == EXDEV)
{
+ struct stat data;
#ifdef S_IFLNK
symlink_target = Ffile_symlink_p (file);
if (! NILP (symlink_target))
***************
*** 2787,2792 ****
--- 2788,2798 ----
so don't have copy-file prompt again. */
NILP (ok_if_already_exists) ? Qnil : Qt,
Qt, Qnil);
+
+ /* Preserve owner and group, if possible (if we are root). */
+ if (stat (SDATA (encoded_file), &data) >= 0)
+ chown (SDATA (encoded_file), data.st_uid, data.st_gid);
+
Fdelete_file (file);
}
else
_______________________________________________
Emacs-diffs mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-diffs