From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13958 invoked by alias); 9 Oct 2006 15:25:02 -0000 Received: (qmail 13900 invoked by uid 22791); 9 Oct 2006 15:25:01 -0000 X-Spam-Check-By: sourceware.org Received: from fra-del-04.spheriq.net (HELO fra-del-04.spheriq.net) (195.46.51.100) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 09 Oct 2006 15:24:52 +0000 Received: from fra-out-01.spheriq.net (fra-out-01.spheriq.net [195.46.51.129]) by fra-del-04.spheriq.net with ESMTP id k99FOmj9017821 for ; Mon, 9 Oct 2006 15:24:48 GMT Received: from fra-cus-02.spheriq.net (fra-cus-02.spheriq.net [195.46.51.38]) by fra-out-01.spheriq.net with ESMTP id k99FOllA022118 for ; Mon, 9 Oct 2006 15:24:47 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by fra-cus-02.spheriq.net with ESMTP id k99FOjHZ008660 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK) for ; Mon, 9 Oct 2006 15:24:47 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 DC864DA48 for ; Mon, 9 Oct 2006 15:21:42 +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 A8476474FD for ; Mon, 9 Oct 2006 15:21:42 +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 CIQ42092 (AUTH "denis pilat"); Mon, 9 Oct 2006 17:21:41 +0200 (CEST) Message-ID: <452A6905.1040308@st.com> Date: Mon, 09 Oct 2006 15:25: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: gdb-patches Subject: [TUI] correctly display windows source files Content-Type: multipart/mixed; boundary="------------000709050205050208050006" 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/msg00076.txt.bz2 This is a multi-part message in MIME format. --------------000709050205050208050006 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 267 Hello, 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. Denis --------------000709050205050208050006 Content-Type: text/plain; name="tui-source.c.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="tui-source.c.patch" Content-length: 768 2006-10-09 Denis Pilat * tui-source.c (tui_set_source_content): handle source files that contain non unix end-of-line. Index: tui/tui-source.c =================================================================== --- tui/tui-source.c (revision 528) +++ tui/tui-source.c (working copy) @@ -194,6 +194,13 @@ tui_set_source_content (struct symtab *s chars until we do */ while (c != EOF && c != '\n' && c != '\r') c = fgetc (stream); + /* Handle non-'\n' end-of-line. */ + if (c == '\r' && (c = fgetc (stream)) != '\n') + { + ungetc (c, stream); + c = '\r'; + } + } } while (c != EOF && c != '\n' && c != '\r' && --------------000709050205050208050006--