[cvslog] (2005-03-03 21:37:46 UTC) Module eggdrop1.9: Change committed!

cvslog cvs at tsss.org
Thu Mar 3 15:37:46 CST 2005


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.9
Commit time: 2005-03-03 21:37:46 UTC
Commited by: Bryan Drewery <lordares at shatow.net>

Modified files:
     lib/eggdrop/ircmasks.c

Log message:

* Added support for 10-19 mask types from mIRC (replaces numbers with '?')

---------------------- diff included ----------------------
Index: eggdrop1.9/lib/eggdrop/ircmasks.c
diff -u eggdrop1.9/lib/eggdrop/ircmasks.c:1.10 eggdrop1.9/lib/eggdrop/ircmasks.c:1.11
--- eggdrop1.9/lib/eggdrop/ircmasks.c:1.10	Thu Mar  3 12:44:47 2005
+++ eggdrop1.9/lib/eggdrop/ircmasks.c	Thu Mar  3 15:37:36 2005
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: ircmasks.c,v 1.10 2005/03/03 18:44:47 stdarg Exp $";
+static const char rcsid[] = "$Id: ircmasks.c,v 1.11 2005/03/03 21:37:36 lordares Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>
@@ -105,12 +105,18 @@
 	return(-1);
 }
 
-/* Type corresponds to the mirc mask types. */
+/* Type corresponds to the mIRC mask types. */
 char *ircmask_create_separate(int type, const char *nick, const char *user, const char *host)
 {
 	char *mask;
 	char ustar[2] = {0, 0};
 	char *domain;
+	int replace_numbers = 0;
+
+	if (type >= 10) {
+		replace_numbers = 1;
+		type -= 10;
+	}
 
 	if (type < 5) nick = "*";
 	if (type == 2 || type == 7) user = "*";
@@ -146,6 +152,13 @@
 	}
 	mask = egg_mprintf("%s!%s%s@%s", nick, ustar, user, domain);
 	free(domain);
+	/* replaces numbers with '?' */
+	if (replace_numbers) {
+		char *c = NULL;
+
+		for (c = mask; *c; ++c)
+			if (isdigit((unsigned char) *c)) *c = '?';
+	}
 	return(mask);
 }
 
----------------------- End of diff -----------------------



More information about the Changes mailing list