summaryrefslogtreecommitdiff
path: root/src/gui/curses
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2011-09-27 21:35:13 +0200
committerSebastien Helleu <flashcode@flashtux.org>2011-09-27 21:35:13 +0200
commitd0f41efeb7753caa1d7408ca71167ceaed320da5 (patch)
tree2623f90f2e2bf0acde231efa9ffae4e602215a91 /src/gui/curses
parenta8c22c11fcdafc6ca936e478d732327d63df46f8 (diff)
downloadweechat-d0f41efeb7753caa1d7408ca71167ceaed320da5.zip
core: fix paste detection (problem with end of lines)
Diffstat (limited to 'src/gui/curses')
-rw-r--r--src/gui/curses/gui-curses-key.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gui/curses/gui-curses-key.c b/src/gui/curses/gui-curses-key.c
index a07727d9d..a303b4f77 100644
--- a/src/gui/curses/gui-curses-key.c
+++ b/src/gui/curses/gui-curses-key.c
@@ -509,7 +509,13 @@ gui_key_read_cb (void *data, int fd)
for (i = 0; i < ret; i++)
{
- gui_key_buffer_add (buffer[i]);
+ /* add all chars (ignore a '\n' after a '\r') */
+ if ((i == 0)
+ || (buffer[i] != '\n')
+ || (buffer[i - 1] != '\r'))
+ {
+ gui_key_buffer_add (buffer[i]);
+ }
}
text_added_to_buffer = 1;