+ if (at && at < excl)
+ excl = NULL;
+
+ if (!at && !excl) {
+ /* Neither "!" nor "@" found: use string as nickname */
+ strlcpy(TheMask, Pattern, sizeof(TheMask) - 5);
+ strlcat(TheMask, "!*@*", sizeof(TheMask));
+ return TheMask;
+ }
+
+ if (!at && excl) {
+ /* Domain part is missing */
+ strlcpy(TheMask, Pattern, sizeof(TheMask) - 3);
+ strlcat(TheMask, "@*", sizeof(TheMask));
+ return TheMask;
+ }
+
+ if (at && !excl) {
+ /* User name is missing */
+ *at = '\0'; at++;
+ strlcpy(TheMask, Pattern, sizeof(TheMask) - 5);
+ strlcat(TheMask, "!*@", sizeof(TheMask));
+ strlcat(TheMask, at, sizeof(TheMask));
+ return TheMask;
+ }
+
+ /* All parts (nick, user and domain name) are given */
+ strlcpy(TheMask, Pattern, sizeof(TheMask));
+ return TheMask;
+} /* Lists_MakeMask */
+
+/**
+ * Check if a client is listed in a list.
+ *
+ * @param h List head.
+ * @param Client Client to check.
+ * @return true if client is listed, false if not.
+ */
+bool
+Lists_Check(struct list_head *h, CLIENT *Client)