Re: CR/LF translation



Hello!

--- On Tue 07/30, Pavel Roskin < proski gnu org > wrote:
> > What about this:
> > 1. binary read file into "raw" chunks with size 64K
> > 2. scan chunks and calculate exact size of  translated file
>
> I don't like this.  You are trying to implement a costly ad-hoc fix for a
> limitation that can be fixed properly, maybe quite easily.
>
> Set edit->last_byte to MAX_INT edit_open_file() and make the editor work
> despite that.  There should not be any inherent need to know the file size
> as long as we are not saving it.
>
> Maybe we should even check sources for other editors that deal with the
> lineend conversion.

It looks like it would be a good idea to review code of mc editor and figure
out why it was written in a way that it reads file in this very strange
manner (i.e. in reverse order) and if possible , do it in more conventional
way (i.e. read start of file to first chunk, end of file to last chunk). If
this this will be done,  it will not be a problem if OS gives a wrong size
of file, or if size of file was changed while doing CR/LF translation. The
only problem with this approach is that it may cause widespread changes,
which will require very thorough testing.

Regards,
Alex





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]