Fix crash when inserting data from non-regular files. See
authorDmitry Antipov <dmantipov@yandex.ru>
Fri, 18 Jan 2013 06:32:12 +0000 (10:32 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Fri, 18 Jan 2013 06:32:12 +0000 (10:32 +0400)
commite07469fa51b2955391255f54917ffb34efd66f1f
treec1d5d48ed06bb7c11b5ad1fc06229e92d1e50ada
parent6772211202c57f0dc96e5725f882a2fa4ee98d2d
Fix crash when inserting data from non-regular files.  See
http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
for the error description produced by valgrind.
* fileio.c (read_non_regular): Rename to read_contents.
Free Lisp_Save_Value object used to pass parameters.
(read_non_regular_quit): Rename to read_contents_quit.
(Finsert_file_contents): Redesign internal file reading loop to adjust
gap and end positions after each read and so help make_gap to work
properly.  Do not signal an I/O error too early and so do not leave
not yet decoded characters in a buffer, which was the reason of
redisplay crash.  Use list2 to build return value.  Adjust comments.
src/ChangeLog
src/fileio.c