Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

matchattr returns 0 with unknown handle and negative flag #1588

Open
crazycatdevs opened this issue May 22, 2024 · 0 comments
Open

matchattr returns 0 with unknown handle and negative flag #1588

crazycatdevs opened this issue May 22, 2024 · 0 comments

Comments

@crazycatdevs
Copy link
Contributor

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:

int ok = 0, nom = 0;
and
if ((u = get_user_by_handle(userlist, argv[1]))) {

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.

crazycatdevs added a commit to crazycatdevs/eggdrop that referenced this issue May 22, 2024
Following eggheads#1588 : initialize ok to -1, sets it to 0 if user is known
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant