scripts.irssi.org icon indicating copy to clipboard operation
scripts.irssi.org copied to clipboard

Update quitrand.pl

Open simcop2387 opened this issue 5 years ago • 4 comments

Clean up the perl a little. Remove an uneccesary loop, use a lexical file handle to avoid possible conflicts, and use chomp instead of chop. chomp will only remove the newline rather than any last character in the line. This fixes a potential bug for the last message in the file if the file doesn't end in a newline.

simcop2387 avatar Jul 13 '20 15:07 simcop2387

it would seem that the array index can go out of the end of lines?

ailin-nemui avatar Jul 14 '20 07:07 ailin-nemui

@fpereda

ailin-nemui avatar Jul 14 '20 07:07 ailin-nemui

It's been a while since I've used irssi (or IRC for that matter). I'm amazed someone is even caring about quitrand.pl at all!

fpereda avatar Jul 14 '20 08:07 fpereda

No idea if anyone uses it but it came up when someone wanted to script separate quit messages for each network :) The perl code was quite outdated - the same with quitmsg.pl - so both scripts got a new shiny coat in case someone needs to use them

vague666 avatar Jul 14 '20 09:07 vague666