[vte/vte-0-52] lib: Filter out BS and DEL from paste



commit d00c15afcd4f50cc57d6bf3bcc87bd6cedf25529
Author: Christian Persch <chpe src gnome org>
Date:   Mon Apr 9 10:55:04 2018 +0200

    lib: Filter out BS and DEL from paste
    
    https://bugzilla.gnome.org/show_bug.cgi?id=794653
    (cherry picked from commit 691db2070ead5894947c7db7c87568aa494fbcfd)

 src/vte.cc |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index ddb16a4..2d26fe6 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -5297,14 +5297,15 @@ VteTerminalPrivate::widget_paste_received(char const* text)
 
         /* Convert newlines to carriage returns, which more software
          * is able to cope with (cough, pico, cough).
-         * Filter out control chars except ^H, ^I, ^J, ^M and ^? (as per xterm).
+         * Filter out control chars except HT, CR (even stricter than xterm).
          * Also filter out C1 controls: U+0080 (0xC2 0x80) - U+009F (0xC2 0x9F). */
         p = paste = (gchar *) g_malloc(len + 1);
         while (p != nullptr && text[0] != '\0') {
                 run = strcspn(text, "\x01\x02\x03\x04\x05\x06\x07"
-                              "\x0A\x0B\x0C\x0E\x0F"
+                              "\x08\x0A\x0B\x0C\x0E\x0F"
                               "\x10\x11\x12\x13\x14\x15\x16\x17"
-                              "\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\xC2");
+                              "\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"
+                              "\x7F\xC2");
                 memcpy(p, text, run);
                 p += run;
                 text += run;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]