Skip to content
Snippets Groups Projects
Commit 2acf42b8 authored by Eric S. Raymond's avatar Eric S. Raymond
Browse files

Address GitLab issue #14: Automatically split long lines in irk

parent 2d9aceca
No related branches found
No related tags found
No related merge requests found
......@@ -43,10 +43,15 @@ def main():
target = sys.argv[1]
message = " ".join(sys.argv[2:])
# Allows pretty formatting of irker messages
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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment