From: Lars Magne Ingebrigtsen Date: Mon, 4 Jul 2011 13:44:52 +0000 (+0200) Subject: * fileio.c (barf_or_query_if_file_exists): Check first if the file X-Git-Tag: emacs-pretest-24.0.90~104^2~152^2~195 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c4f2d8d48d29b35ba5f0d7734be8e8b0b8b71798;p=emacs.git * 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). --- diff --git a/src/ChangeLog b/src/ChangeLog index 18ecc1ae41f..1be9b09381e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2011-07-04 Lars Magne Ingebrigtsen + * 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'. diff --git a/src/fileio.c b/src/fileio.c index 27fef42960a..6a4d1c55680 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -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);