emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 dd1d8414b33: Fix insert-file-contents with pipes and /dev/stdin


From: Eli Zaretskii
Subject: emacs-29 dd1d8414b33: Fix insert-file-contents with pipes and /dev/stdin
Date: Tue, 8 Aug 2023 15:19:47 -0400 (EDT)

branch: emacs-29
commit dd1d8414b33fe620cf21361a4f089d5f14ff454c
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Fix insert-file-contents with pipes and /dev/stdin
    
    * src/fileio.c (Finsert_file_contents): Restore logic of
    non-regular but seekable files.  (Bug#65156)
---
 src/fileio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/fileio.c b/src/fileio.c
index 995e4142f58..55132f1ec38 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -4581,7 +4581,7 @@ by calling `format-decode', which see.  */)
       goto handled;
     }
 
-  if (seekable || !NILP (end))
+  if ((seekable && regular) || !NILP (end))
     total = end_offset - beg_offset;
   else
     /* For a special file, all we can do is guess.  */
@@ -4678,7 +4678,7 @@ by calling `format-decode', which see.  */)
           For a special file, where TOTAL is just a buffer size,
           so don't bother counting in HOW_MUCH.
           (INSERTED is where we count the number of characters inserted.)  */
-       if (seekable || !NILP (end))
+       if ((seekable && regular) || !NILP (end))
          how_much += this;
        inserted += this;
       }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]