diff options
| author | Paul Eggert | 2025-07-11 16:32:31 -0700 |
|---|---|---|
| committer | Paul Eggert | 2025-07-13 21:09:39 -0700 |
| commit | 6d09a339ceb986de6d2a49ac8c20a7360f57b7d6 (patch) | |
| tree | e63c76420384138e790d1354c2b2f2f669c72797 /src/pgtkselect.c | |
| parent | b911029f96b14a03398198d5a849d6f4d0d1e071 (diff) | |
| download | emacs-6d09a339ceb986de6d2a49ac8c20a7360f57b7d6.tar.gz emacs-6d09a339ceb986de6d2a49ac8c20a7360f57b7d6.zip | |
Improve insert-file-contents on non-regular files
This is part of a fix for Bug#77315,
and improves on the fix for Bug#71258.
* src/fileio.c (Finsert_file_contents): Do not pretend that
directories are regular files. Instead, signal an error when
attempting to read from them in the usual case where the OS
prohibits that; and otherwise read from them. However, when
visiting a directory report an error right away rather than
waiting until later, as this function is documented to not allow
visiting non-regular files. Nest the struct stat into a small
code block, to keep the code simpler and so that the compiler can
see what parts are used and can issue better diagnostics if
uninitialized storage is accessed. Be more skeptical of st_size,
when the file is not regular.
Diffstat (limited to 'src/pgtkselect.c')
0 files changed, 0 insertions, 0 deletions