aboutsummaryrefslogtreecommitdiffstats
path: root/src/fileio.c
diff options
context:
space:
mode:
authorKaroly Lorentey2004-05-07 14:20:00 +0000
committerKaroly Lorentey2004-05-07 14:20:00 +0000
commit52f9ab73a16c71ffe7f8a1c25f9432bbe32f10cf (patch)
tree399c54ddfa7cac6c90a07a81308bf7f5e71b66bd /src/fileio.c
parentb160ff41a813213adfa745a9d009ab638a22d7b1 (diff)
parenta478f3e181bd9925ecb506abf4e49216d392124a (diff)
downloademacs-52f9ab73a16c71ffe7f8a1c25f9432bbe32f10cf.tar.gz
emacs-52f9ab73a16c71ffe7f8a1c25f9432bbe32f10cf.zip
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-268 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-269 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-270 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-271 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-272 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-273 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-274 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-275 Update from CVS: man/makefile.w32-in: Revert last change * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-276 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-277 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-278 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-279 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-280 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-281 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-282 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-283 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-284 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-285 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-286 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-157
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/fileio.c b/src/fileio.c
index db1aac0afda..bd84ce6121b 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2351,7 +2351,7 @@ barf_or_query_if_file_exists (absname, querystring, interactive, statptr, quick)
2351 2351
2352 /* stat is a good way to tell whether the file exists, 2352 /* stat is a good way to tell whether the file exists,
2353 regardless of what access permissions it has. */ 2353 regardless of what access permissions it has. */
2354 if (stat (SDATA (encoded_filename), &statbuf) >= 0) 2354 if (lstat (SDATA (encoded_filename), &statbuf) >= 0)
2355 { 2355 {
2356 if (! interactive) 2356 if (! interactive)
2357 Fsignal (Qfile_already_exists, 2357 Fsignal (Qfile_already_exists,
@@ -2686,11 +2686,11 @@ This is what happens in interactive use with M-x. */)
2686 Lisp_Object args[2]; 2686 Lisp_Object args[2];
2687#endif 2687#endif
2688 Lisp_Object handler; 2688 Lisp_Object handler;
2689 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; 2689 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
2690 Lisp_Object encoded_file, encoded_newname; 2690 Lisp_Object encoded_file, encoded_newname, symlink_target;
2691 2691
2692 encoded_file = encoded_newname = Qnil; 2692 symlink_target = encoded_file = encoded_newname = Qnil;
2693 GCPRO4 (file, newname, encoded_file, encoded_newname); 2693 GCPRO5 (file, newname, encoded_file, encoded_newname, symlink_target);
2694 CHECK_STRING (file); 2694 CHECK_STRING (file);
2695 CHECK_STRING (newname); 2695 CHECK_STRING (newname);
2696 file = Fexpand_file_name (file, Qnil); 2696 file = Fexpand_file_name (file, Qnil);
@@ -2727,10 +2727,17 @@ This is what happens in interactive use with M-x. */)
2727 { 2727 {
2728 if (errno == EXDEV) 2728 if (errno == EXDEV)
2729 { 2729 {
2730 Fcopy_file (file, newname, 2730#ifdef S_IFLNK
2731 /* We have already prompted if it was an integer, 2731 symlink_target = Ffile_symlink_p (file);
2732 so don't have copy-file prompt again. */ 2732 if (! NILP (symlink_target))
2733 NILP (ok_if_already_exists) ? Qnil : Qt, Qt); 2733 Fmake_symbolic_link (symlink_target, newname,
2734 NILP (ok_if_already_exists) ? Qnil : Qt, Qt);
2735 else
2736#endif
2737 Fcopy_file (file, newname,
2738 /* We have already prompted if it was an integer,
2739 so don't have copy-file prompt again. */
2740 NILP (ok_if_already_exists) ? Qnil : Qt, Qt);
2734 Fdelete_file (file); 2741 Fdelete_file (file);
2735 } 2742 }
2736 else 2743 else