aboutsummaryrefslogtreecommitdiff
path: root/gdb/top.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/top.c')
-rw-r--r--gdb/top.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/top.c b/gdb/top.c
index 18be649..5d3c116 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1447,7 +1447,15 @@ gdb_readline (prrompt)
}
if (c == '\n')
+#ifndef CRLF_SOURCE_FILES
break;
+#else
+ {
+ if (input_index > 0 && result[input_index - 1] == '\r')
+ input_index--;
+ break;
+ }
+#endif
result[input_index++] = c;
while (input_index >= result_size)