This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[TUI] correctly display windows source files
- From: Denis PILAT <denis dot pilat at st dot com>
- To: gdb-patches <gdb-patches at sourceware dot org>
- Date: Mon, 09 Oct 2006 17:21:41 +0200
- Subject: [TUI] correctly display windows source files
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
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' &&