aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2025-01-19 12:51:18 +0200
committerEli Zaretskii2025-01-19 12:51:18 +0200
commit26c9fbc94dae34fc119828661c71242d80bb33c5 (patch)
treed0b0539301f7de3fcfe0cb808b94fa3831077d96 /src
parent40a8d0ebf0ca6199697c95a308201e739dd9540d (diff)
downloademacs-26c9fbc94dae34fc119828661c71242d80bb33c5.tar.gz
emacs-26c9fbc94dae34fc119828661c71242d80bb33c5.zip
Fix visiting files in /proc/ directory
* src/fileio.c (Finsert_file_contents): Treat regular files whose size is reported as zero as if they were special files. (Bug#75569)
Diffstat (limited to 'src')
-rw-r--r--src/fileio.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/fileio.c b/src/fileio.c
index db7c491e1a1..bf80d71ab59 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -4747,10 +4747,11 @@ by calling `format-decode', which see. */)
4747 goto handled; 4747 goto handled;
4748 } 4748 }
4749 4749
4750 if (seekable || !NILP (end)) 4750 /* Don't believe st.st_size if it is zero. */
4751 if ((regular && st.st_size > 0) || (!regular && seekable) || !NILP (end))
4751 total = end_offset - beg_offset; 4752 total = end_offset - beg_offset;
4752 else 4753 else
4753 /* For a special file, all we can do is guess. */ 4754 /* For a special file that is not seekable, all we can do is guess. */
4754 total = READ_BUF_SIZE; 4755 total = READ_BUF_SIZE;
4755 4756
4756 if (NILP (visit) && total > 0) 4757 if (NILP (visit) && total > 0)