summaryrefslogtreecommitdiff
path: root/user/quassel/unterminated-mIRC-codes.patch
diff options
context:
space:
mode:
authorKiyoshi Aman <kiyoshi.aman+adelie@gmail.com>2019-06-04 07:57:22 -0500
committerKiyoshi Aman <kiyoshi.aman+adelie@gmail.com>2019-06-04 07:57:22 -0500
commit7f5f88bd5ffbbe9243ead0610a4d773b2e646885 (patch)
tree98261178bab95968974ece4a23391bb7e1c7d801 /user/quassel/unterminated-mIRC-codes.patch
parentf3e94dd49bc972594357851cc2ec46a9fbf4e254 (diff)
parent5e5928e219124dc422830bc24cfe0fba7e86b8d4 (diff)
downloadpackages-7f5f88bd5ffbbe9243ead0610a4d773b2e646885.tar.gz
packages-7f5f88bd5ffbbe9243ead0610a4d773b2e646885.tar.bz2
packages-7f5f88bd5ffbbe9243ead0610a4d773b2e646885.tar.xz
packages-7f5f88bd5ffbbe9243ead0610a4d773b2e646885.zip
Merge branch 'master' of code.foxkit.us:adelie/packages into bump.aerdan.20190604
Diffstat (limited to 'user/quassel/unterminated-mIRC-codes.patch')
-rw-r--r--user/quassel/unterminated-mIRC-codes.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/user/quassel/unterminated-mIRC-codes.patch b/user/quassel/unterminated-mIRC-codes.patch
new file mode 100644
index 000000000..8cedeb461
--- /dev/null
+++ b/user/quassel/unterminated-mIRC-codes.patch
@@ -0,0 +1,40 @@
+From 391cdf6c2595060ff3b2adb54f5b2fc8ebd7cc04 Mon Sep 17 00:00:00 2001
+From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
+Date: Mon, 3 Jun 2019 00:16:30 -0500
+Subject: [PATCH] multilineedit: handle unterminated mIRC codes
+
+Currently, if an unterminated mIRC code is pasted into Quassel, trying to
+go through input line history will cause a deadlock. This breaks the loop
+at the cost of possibly mangling the formatting of the line somewhat.
+This is seen as more acceptable than locking up, and the line is invalid
+anyway.
+
+Reproducer:
+
+```sh
+printf '\00303,08HONK' | xclip -selection clipboard
+```
+
+Paste into Quassel, send, press Up arrow key.
+---
+ src/uisupport/multilineedit.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/uisupport/multilineedit.cpp b/src/uisupport/multilineedit.cpp
+index 133a2433..b13834c5 100644
+--- a/src/uisupport/multilineedit.cpp
++++ b/src/uisupport/multilineedit.cpp
+@@ -645,6 +645,10 @@ QString MultiLineEdit::convertMircCodesToHtml(const QString &text)
+ }
+
+ posRight = text.indexOf(mircCode.cap(), posRight + 1);
++ if (posRight == -1) {
++ words << text.mid(posLeft);
++ break; // unclosed color code; can't process
++ }
+ words << text.mid(posLeft, posRight + 1 - posLeft);
+ posLeft = posRight + 1;
+ }
+--
+2.21.0
+