Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [TUI] correctly display windows source files
@ 2006-10-09 15:25 Denis PILAT
  2006-10-09 18:01 ` Mark Kettenis
  2006-10-09 19:28 ` Eli Zaretskii
  0 siblings, 2 replies; 19+ messages in thread
From: Denis PILAT @ 2006-10-09 15:25 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 267 bytes --]

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

[-- Attachment #2: tui-source.c.patch --]
[-- Type: text/plain, Size: 768 bytes --]

2006-10-09  Denis Pilat  <denis.pilat@st.com>

	* 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' &&

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2006-10-16  8:51 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-09 15:25 [TUI] correctly display windows source files Denis PILAT
2006-10-09 18:01 ` Mark Kettenis
2006-10-09 19:28 ` Eli Zaretskii
2006-10-10 13:23   ` Denis PILAT
2006-10-10 15:08     ` '\r' only end-of-line Denis PILAT
2006-10-10 21:34       ` Eli Zaretskii
2006-10-11 10:08         ` Denis PILAT
2006-10-11 13:33           ` Daniel Jacobowitz
2006-10-11 13:57             ` Andrew STUBBS
2006-10-11 14:01               ` Daniel Jacobowitz
2006-10-11 14:44                 ` Andrew STUBBS
2006-10-11 15:05                   ` Daniel Jacobowitz
2006-10-11 17:47             ` Eli Zaretskii
2006-10-11 17:36           ` Eli Zaretskii
2006-10-16  8:51             ` Denis PILAT
2006-10-10 21:24     ` [TUI] correctly display windows source files Eli Zaretskii
2006-10-11  8:02       ` Denis PILAT
2006-10-11  8:39         ` Eli Zaretskii
2006-10-11 11:23           ` Frederic RISS

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox