aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.h
diff options
context:
space:
mode:
authorPaul Eggert2025-07-17 09:50:07 -0700
committerPaul Eggert2025-07-21 16:23:17 -0700
commit8d83402edc96b5a88096ae707241f4e8cb59691b (patch)
treecbf3728536de946c427a7e5ee6b4416816c3789a /src/buffer.h
parent5485bda52399a23d95ab593dcb748975ee0654d0 (diff)
downloademacs-8d83402edc96b5a88096ae707241f4e8cb59691b.tar.gz
emacs-8d83402edc96b5a88096ae707241f4e8cb59691b.zip
insert-file-contents st_size cleanup
* src/fileio.c (Finsert_file_contents): Store st_size, not file_size_hint, into current_buffer->modtime_size, since modtime_size is compared to a later st_size, not to the actual file size. Simplify buffer overflow detection from file size, since this occurred only on regular files.
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/buffer.h b/src/buffer.h
index 26a334ea810..302daac3e04 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -649,11 +649,12 @@ struct buffer
649 in no case complain about any mismatch on next save attempt. */ 649 in no case complain about any mismatch on next save attempt. */
650 struct timespec modtime; 650 struct timespec modtime;
651 651
652 /* Size of the file when modtime was set. This is used to detect the 652 /* Size of the file when modtime was set. This is used to detect when
653 case where the file grew while we were reading it, so the modtime 653 the file size changed while we were reading the file, but the
654 is still the same (since it's rounded up to seconds) but we're actually 654 modtime is still the same (since it's truncated to clock resolution)
655 not up-to-date. -1 means the size is unknown. Only meaningful if 655 so we're actually not up-to-date. Meaningful only if it is
656 modtime is actually set. */ 656 nonnegative and the modtime is actually set. Useful only on
657 platforms with coarse clock resolution. */
657 off_t modtime_size; 658 off_t modtime_size;
658 659
659 /* The value of text->modiff at the last auto-save. */ 660 /* The value of text->modiff at the last auto-save. */