]> git.eshelyaron.com Git - emacs.git/commitdiff
* fileio.c (barf_or_query_if_file_exists): Check first if the file
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 4 Jul 2011 13:44:52 +0000 (15:44 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 4 Jul 2011 13:44:52 +0000 (15:44 +0200)
is a directory before asking whether to use the file name
(bug#7564).

src/ChangeLog
src/fileio.c

index 18ecc1ae41f7ae07c2047519280777b05af7cd0b..1be9b09381e3ed10c8b34a2a474ffd57a9377715 100644 (file)
@@ -1,5 +1,9 @@
 2011-07-04  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * fileio.c (barf_or_query_if_file_exists): Check first if the file
+       is a directory before asking whether to use the file name
+       (bug#7564).
+
        * fns.c (Frequire): Remove the mention of the .gz files, since
        that's installation-specific, but keep the mention of
        `get-load-suffixes'.
index 27fef42960a9fd2cc0fad8e72c69305c344034d7..6a4d1c556808ee410970ee0f1eb0bb8c5e99337b 100644 (file)
@@ -1755,6 +1755,10 @@ barf_or_query_if_file_exists (Lisp_Object absname, const char *querystring,
      regardless of what access permissions it has.  */
   if (lstat (SSDATA (encoded_filename), &statbuf) >= 0)
     {
+      if (Ffile_directory_p (absname))
+       xsignal2 (Qfile_error,
+                 build_string ("File name is a directory"), absname);
+
       if (! interactive)
        xsignal2 (Qfile_already_exists,
                  build_string ("File already exists"), absname);