From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24303 invoked by alias); 10 Oct 2006 13:23:22 -0000 Received: (qmail 24295 invoked by uid 22791); 10 Oct 2006 13:23:22 -0000 X-Spam-Check-By: sourceware.org Received: from fra-del-02.spheriq.net (HELO fra-del-02.spheriq.net) (195.46.51.98) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 10 Oct 2006 13:23:16 +0000 Received: from fra-out-03.spheriq.net (fra-out-03.spheriq.net [195.46.51.131]) by fra-del-02.spheriq.net with ESMTP id k9ADNCSF024582 for ; Tue, 10 Oct 2006 13:23:12 GMT Received: from fra-cus-01.spheriq.net (fra-cus-01.spheriq.net [195.46.51.37]) by fra-out-03.spheriq.net with ESMTP id k9ADNBRe019789 for ; Tue, 10 Oct 2006 13:23:12 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by fra-cus-01.spheriq.net with ESMTP id k9ADN8dJ020905 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Tue, 10 Oct 2006 13:23:11 GMT Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 82054DA44; Tue, 10 Oct 2006 13:23:07 +0000 (GMT) Received: from mail1.cro.st.com (mail1.cro.st.com [164.129.40.131]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 3F1E7474D3; Tue, 10 Oct 2006 13:23:07 +0000 (GMT) Received: from st.com (crx1177.cro.st.com [164.129.47.77]) by mail1.cro.st.com (MOS 3.5.8-GR) with ESMTP id CIQ66074 (AUTH "denis pilat"); Tue, 10 Oct 2006 15:23:06 +0200 (CEST) Message-ID: <452B9EB9.4040709@st.com> Date: Tue, 10 Oct 2006 13:23:00 -0000 From: Denis PILAT User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.0.1) Gecko/20020920 Netscape/7.0 MIME-Version: 1.0 To: Eli Zaretskii Cc: gdb-patches@sourceware.org Subject: Re: [TUI] correctly display windows source files References: <452A6905.1040308@st.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-10/txt/msg00090.txt.bz2 Eli Zaretskii wrote: >>Date: Mon, 09 Oct 2006 17:21:41 +0200 >>From: Denis PILAT >> >>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