Re: [TUI] correctly display windows source files

Denis PILAT
2006-10-10T13:23:22Z

Eli Zaretskii wrote:

>>Date: Mon, 09 Oct 2006 17:21:41 +0200
>>From: Denis PILAT <denis.pilat@st.com>
>>
>>The TUI displays windows source files with and extra blank line between
>>each source line.
>>Line number are wrong and changes when source is moved up and down.
>>
>>This patch fixes this problem and should take the case of MAC OS
>>end-of-line into account.
>>
>>
>
>This is okay with me, but please be sure to test the code near the end
>of the file, because, according to my references, an attempt to ungetc
>EOF is ignored. What happens with a file that ends in a sole `\r'that?
>
>
>
I've tried files with '\r' end-of-lines but there are problems to open
them, in source.c:find_source_lines, only \n are taken as end-of-line.
Therefore the struct symtab given as an input parameter of
tui_set_source_content() function is wrong, that prevents the file to be
read correctly.

I don't want to mix this patch to a patch that may fix the problem in
source.c. I'll have a look at that anyway but I guess there could be a
lot of problem elsewhere to open '\r' only end-of-line files.

About your remark,
I've tried to ungetc(EOF) and I did not get any problem, after
ungetc(EOF) the next call to fgetc is still EOF.

Denis