Subject: bug#65609: 30.0.50; inhibit-eol-conversion breaks revert-buffer

From: Eli Zaretskii <[email-masked]>
Date: Wed, 30 Aug 2023 17:18:29 +0300

> From: Po Lu <[email-masked]>
> Cc: Andrew Scott <[email-masked]>,  Gerd Möllmann
>  <[email-masked]>,  "Herbert J. Skuhra" <[email-masked]>,
>   [email-masked]
> Date: Wed, 30 Aug 2023 21:43:23 +0800
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > Thanks for an easy test case.  We are reading too much from the file
> > on disk when reverting in this case.
> >
> > Po Lu, I think we need the patch below to fix this.  Gerd, does this
> > solve your problem as well, including the abort during bootstrap?
> > Herbert, I think this could also be related to the problems you see,
> > so please try the patch below.
> >
> > diff --git a/src/fileio.c b/src/fileio.c
> > index 23e1a83..8919e08 100644
> > --- a/src/fileio.c
> > +++ b/src/fileio.c
> > @@ -4805,7 +4805,7 @@ DEFUN ("insert-file-contents", Finsert_file_contents, Sinsert_file_contents,
> >  
> >  	/* 'try' is reserved in some compilers (Microsoft C).  */
> >  	ptrdiff_t trytry = min (gap_size, READ_BUF_SIZE);
> > -	if (!NILP (end))
> > +	if (seekable || !NILP (end))
> >  	  trytry = min (trytry, total - inserted);
> >  
> >  	if (!seekable && NILP (end))
> 
> I don't believe this should incur any difficulties upon the Android
> port, so please proceed with installing it if it works.

Thanks, installed on master.  I will wait to hear from Andrew before
closing the bug.