summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-03-08 21:55:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-03-08 21:55:00 +0000
commitc82585d3e6c435cae68d0990c12eda15c798bfeb (patch)
treea65d78cc6d1348d7933cfb4c9397e123d4076ce1
parentAdding patch from Richard Nelson <unixabg@gmail.com> to fix pretty formatting... (diff)
downloadirker-c82585d3e6c435cae68d0990c12eda15c798bfeb.tar.xz
irker-c82585d3e6c435cae68d0990c12eda15c798bfeb.zip
Adding patch from upstream to automatically split long lines.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
-rw-r--r--debian/patches/progress-linux/0002-split-long-lines.patch24
-rw-r--r--debian/patches/series1
2 files changed, 25 insertions, 0 deletions
diff --git a/debian/patches/progress-linux/0002-split-long-lines.patch b/debian/patches/progress-linux/0002-split-long-lines.patch
new file mode 100644
index 0000000..91fe23d
--- /dev/null
+++ b/debian/patches/progress-linux/0002-split-long-lines.patch
@@ -0,0 +1,24 @@
+Author: Eric S. Raymond <esr@thyrsus.com>
+Description: Automatically split long lines in irk.
+
+diff -Naurp irker.orig/irk irker/irk
+--- irker.orig/irk
++++ irker/irk
+@@ -39,10 +39,15 @@ def irk(target, message, server = DEFAUL
+ def main():
+ target = sys.argv[1]
+ message = " ".join(sys.argv[2:])
+- message = message.decode('string_escape')
++ if str == bytes:
++ message = message.decode('string_escape')
+
++ # The actual IRC limit is 512. Avoid any off-by-ones
++ chunksize = 511
+ try:
+- irk(target, message)
++ while message[:chunksize]:
++ irk(target, message[:chunksize])
++ message = message[chunksize:]
+ except socket.error as e:
+ sys.stderr.write("irk: write to server failed: %r\n" % e)
+ sys.exit(1)
diff --git a/debian/patches/series b/debian/patches/series
index ff9a078..9ea6acc 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -10,3 +10,4 @@
0013-Fix-incorrect-name-in-Makefile.patch
0011-Import-upstream-tweaks-to-irkerd.service.patch
progress-linux/0001-message-decode.patch
+progress-linux/0002-split-long-lines.patch