# HG changeset patch # User Gerd Moellmann # Date 987608075 0 # Node ID 2db1b1bb1d185bc4811b3674d9a30277bba648bd # Parent 3061b65a98979295f5088bd96ea5db93be44dd28 (Finsert_file_contents): If the file size returned from stat is zero, set END to READ_BUF_SIZE. This makes sure we can read from files on a procfs whose contents are generated dynamically. diff -r 3061b65a9897 -r 2db1b1bb1d18 src/fileio.c --- a/src/fileio.c Wed Apr 18 15:09:36 2001 +0000 +++ b/src/fileio.c Wed Apr 18 15:34:35 2001 +0000 @@ -3589,6 +3589,12 @@ if (XINT (end) != st.st_size || ((int) st.st_size * 4) / 4 != st.st_size) error ("Maximum buffer size exceeded"); + + /* The file size returned from stat may be zero, but data + may be readable nonetheless, for example when this is a + file in the /proc filesystem. */ + if (st.st_size == 0) + XSETINT (end, READ_BUF_SIZE); } }