From ceeccff464dbe878ba5214199a5dff060628cbeb Mon Sep 17 00:00:00 2001 From: Tobias Girstmair Date: Sat, 25 May 2024 23:00:12 +0200 Subject: [PATCH] params cannot be empty ... because we always append a final argument, even if it's the empty string. there actually is a slight bug with empty line or ones with only a prefix here (command becomes b""), but these are broken anyways. --- contrib/highlight | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/contrib/highlight b/contrib/highlight index e23130f..34d390d 100755 --- a/contrib/highlight +++ b/contrib/highlight @@ -1,5 +1,4 @@ #!/usr/bin/python3 - import re, sys def parse(line): #-> [nick, user, host], command, arguments @@ -18,9 +17,7 @@ def parse(line): #-> [nick, user, host], command, arguments # handle final parameter: params += [line.removeprefix(b":")] - if params: - # note: command may also be a numeric reply - command, *arguments = params + command, *arguments = params # note: command may also be a numeric reply if b"!" in prefix and b"@" in prefix: nick, rest = prefix.removeprefix(b":").split(b"!", 1) -- 2.39.3