eggdrop
eggdrop copied to clipboard
matchattr returns 0 with unknown handle and negative flag
In a script, I want to act only if user is not known as halfop or more.
Logical test:
if {[matchattr $handle -l|-l $chan]} { ... do stuff }
But if user is not known, matchattr returns 0, as if the user has the +l flag. Culprits: https://github.com/eggheads/eggdrop/blob/e28a0a023fe077fbec2343f8eb494371138fcd44/src/tcluser.c#L254 and https://github.com/eggheads/eggdrop/blob/e28a0a023fe077fbec2343f8eb494371138fcd44/src/tcluser.c#L258 If the user is not known, it returns default value which is 0. Peharps could it be better to initialize it to -1 (user unknown), sets it to 0 if entering the condition and then do the stuff.