about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2011-12-25 19:42:03 +0100
committerAlexander Barton <alex@barton.de>2011-12-25 19:42:03 +0100
commit1e4a00f94f32edf5c2240864b7e56f69636312f4 (patch)
tree16964e1b632c0ac9a9c0615e685888f9ea915a2f /src
parent338758799d601a4f70c379d2d692b0178cea882f (diff)
downloadngircd-1e4a00f94f32edf5c2240864b7e56f69636312f4.tar.gz
ngircd-1e4a00f94f32edf5c2240864b7e56f69636312f4.zip
Lists_CheckDupeMask(): return pointer to already existing item
The old behavior of returning true/false is compatible to this change,
so there are no other code changes required.
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/lists.c6
-rw-r--r--src/ngircd/lists.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/ngircd/lists.c b/src/ngircd/lists.c
index 63c16b0d..11f8e888 100644
--- a/src/ngircd/lists.c
+++ b/src/ngircd/lists.c
@@ -240,17 +240,17 @@ Lists_Free(struct list_head *head)
  * @param Mask IRC mask to test.
  * @return true if mask is already stored in the list, false otherwise.
  */
-GLOBAL bool
+GLOBAL struct list_elem *
 Lists_CheckDupeMask(const struct list_head *h, const char *Mask )
 {
 	struct list_elem *e;
 	e = h->first;
 	while (e) {
 		if (strcasecmp(e->mask, Mask) == 0)
-			return true;
+			return e;
 		e = e->next;
 	}
-	return false;
+	return NULL;
 }
 
 /**
diff --git a/src/ngircd/lists.h b/src/ngircd/lists.h
index f9a4c91c..f709f3fa 100644
--- a/src/ngircd/lists.h
+++ b/src/ngircd/lists.h
@@ -30,7 +30,7 @@ GLOBAL struct list_elem *Lists_GetFirst PARAMS((const struct list_head *));
 GLOBAL struct list_elem *Lists_GetNext PARAMS((const struct list_elem *));
 
 GLOBAL bool Lists_Check PARAMS((struct list_head *head, CLIENT *client));
-GLOBAL bool Lists_CheckDupeMask PARAMS((const struct list_head *head,
+GLOBAL struct list_elem *Lists_CheckDupeMask PARAMS((const struct list_head *head,
 					const char *mask));
 
 GLOBAL bool Lists_Add PARAMS((struct list_head *h, const char *Mask,