]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix error message from 'insert-file-contents'
authorEli Zaretskii <eliz@gnu.org>
Wed, 29 May 2024 14:41:01 +0000 (17:41 +0300)
committerEshel Yaron <me@eshelyaron.com>
Wed, 29 May 2024 16:00:49 +0000 (18:00 +0200)
* src/fileio.c (Finsert_file_contents): Consider directories
to be "regular" files.  (Bug#71258)

(cherry picked from commit 8f618711d13fb82b10b67a12f47736e01ec4b92b)

src/fileio.c

index 960a3b21dc0ae506862a708d76131456f96a4c75..9955f83e6252206b0f43133f2ee45a73d6b2d844 100644 (file)
@@ -4188,7 +4188,7 @@ by calling `format-decode', which see.  */)
      named pipes, and it's probably just not worth it.  So we should
      at least signal an error.  */
 
-  if (!S_ISREG (st.st_mode))
+  if (!(S_ISREG (st.st_mode) || S_ISDIR (st.st_mode)))
     {
       regular = false;