diff options
Diffstat (limited to 'gdb/event-top.c')
-rw-r--r-- | gdb/event-top.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/event-top.c b/gdb/event-top.c index 9a02ac6..f0c07ba 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -251,6 +251,14 @@ gdb_rl_callback_handler (char *rl) noexcept static struct gdb_exception gdb_rl_expt; struct ui *ui = current_ui; + /* In bracketed paste mode, pasting a complete line can result in a + literal newline appearing at the end of LINE. However, we never + want this in gdb. */ + size_t len = strlen (rl); + while (len > 0 && (rl[len - 1] == '\r' || rl[len - 1] == '\n')) + --len; + rl[len] = '\0'; + try { /* Ensure the exception is reset on each call. */ |