aboutsummaryrefslogtreecommitdiffstats
path: root/FICS
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2023-12-15 20:25:17 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2023-12-15 20:25:17 +0100
commit7d5fbd58e7a02444102270cff8fb73fa0d351ba1 (patch)
tree34dad5a6525bfa3fbf194d055ba453a8513b4f55 /FICS
parent3cfda9fd19db6f9a902a5b5835cffdbe44f8e62a (diff)
Reformatted in_list()
Diffstat (limited to 'FICS')
-rw-r--r--FICS/lists.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/FICS/lists.c b/FICS/lists.c
index 7b3039a..5a19d30 100644
--- a/FICS/lists.c
+++ b/FICS/lists.c
@@ -215,26 +215,28 @@ PRIVATE List *list_findpartial(int p, char *which, int gonnado)
return gl;
}
-/* see if something is in a list */
-PUBLIC int in_list(int p, enum ListWhich which, char *member)
+/*
+ * See if something is in a list
+ */
+PUBLIC int
+in_list(int p, enum ListWhich which, char *member)
{
- List *gl;
- int i;
- int filterList = (which == L_FILTER);
-
- gl = list_find(p, which);
- if ((gl == NULL) || (member == NULL))
- return 0;
- for (i = 0; i < gl->numMembers; i++) {
- if (filterList) {
- if (!strncasecmp(member, gl->member[i], strlen(gl->member[i])))
- return 1;
- } else {
- if (!strcasecmp(member, gl->member[i]))
- return 1;
- }
- }
- return 0;
+ List *gl;
+ int filterList = (which == L_FILTER);
+
+ if ((gl = list_find(p, which)) == NULL || member == NULL)
+ return 0;
+ for (int i = 0; i < gl->numMembers; i++) {
+ if (filterList) {
+ if (!strncasecmp(member, gl->member[i],
+ strlen(gl->member[i])))
+ return 1;
+ } else {
+ if (!strcasecmp(member, gl->member[i]))
+ return 1;
+ }
+ }
+ return 0;
}
/*