aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui/tui-source.c
diff options
context:
space:
mode:
authorFrederic Riss <frederic.riss@st.com>2006-10-11 10:50:07 +0000
committerFrederic Riss <frederic.riss@st.com>2006-10-11 10:50:07 +0000
commit861cf606cb1195b79daff1ae5a0202ea7b9679bd (patch)
tree7e4a6d95f73d865242ee41707bedde6704227f5b /gdb/tui/tui-source.c
parentbff368bd19909b8755283a51e7f3d98c59c1f8f3 (diff)
downloadbinutils-861cf606cb1195b79daff1ae5a0202ea7b9679bd.zip
binutils-861cf606cb1195b79daff1ae5a0202ea7b9679bd.tar.gz
binutils-861cf606cb1195b79daff1ae5a0202ea7b9679bd.tar.bz2
2006-10-11 Denis Pilat <denis.pilat@st.com>
* tui/tui-source.c (tui_set_source_content): handle source files that contain non unix end-of-line.
Diffstat (limited to 'gdb/tui/tui-source.c')
-rw-r--r--gdb/tui/tui-source.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c
index c7bcea6..3460324 100644
--- a/gdb/tui/tui-source.c
+++ b/gdb/tui/tui-source.c
@@ -194,6 +194,14 @@ tui_set_source_content (struct symtab *s, int line_no, int noerror)
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' && c != EOF)
+ {
+ ungetc (c, stream);
+ c = '\r';
+ }
+
}
}
while (c != EOF && c != '\n' && c != '\r' &&