[cvslog] (2004-04-06 07:15:28 UTC) Module eggdrop1.6: Change committed

cvslog cvs at tsss.org
Tue Apr 6 01:15:28 CST 2004


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2004-04-06 07:15:28 UTC
Commited by: Will Buckner <wcc at techmonkeys.org>

Modified files:
     doc/UPDATES1.6 src/chanprog.c src/patch.h

Log message:

* Rewrote isowner(). Patch by Sup.

---------------------- diff included ----------------------
Index: eggdrop1.6/doc/UPDATES1.6
diff -u eggdrop1.6/doc/UPDATES1.6:1.545 eggdrop1.6/doc/UPDATES1.6:1.546
--- eggdrop1.6/doc/UPDATES1.6:1.545	Tue Apr  6 01:50:11 2004
+++ eggdrop1.6/doc/UPDATES1.6	Tue Apr  6 02:15:18 2004
@@ -1,4 +1,4 @@
-$Id: UPDATES1.6,v 1.545 2004/04/06 06:50:11 wcc Exp $
+$Id: UPDATES1.6,v 1.546 2004/04/06 07:15:18 wcc Exp $
 
 Eggdrop Changes (since v1.6.0)
      _________________________________________________________________
@@ -11,6 +11,9 @@
     ftp://ftp.eggheads.org/pub/eggdrop/UPDATES/
 
   1.6.16:
+    - Rewrote isowner() completely.
+    * Patch by: Sup
+
     - Better support for non-standard "op" prefixes (UnrealIRCD, etc.).
     * Patch by: Sven
 
Index: eggdrop1.6/src/chanprog.c
diff -u eggdrop1.6/src/chanprog.c:1.50 eggdrop1.6/src/chanprog.c:1.51
--- eggdrop1.6/src/chanprog.c:1.50	Wed Feb 25 17:08:12 2004
+++ eggdrop1.6/src/chanprog.c	Tue Apr  6 02:15:18 2004
@@ -7,7 +7,7 @@
  *   telling the current programmed settings
  *   initializing a lot of stuff and loading the tcl scripts
  *
- * $Id: chanprog.c,v 1.50 2004/02/25 23:08:12 stdarg Exp $
+ * $Id: chanprog.c,v 1.51 2004/04/06 07:15:18 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -654,38 +654,31 @@
   }
 }
 
-/* Oddly enough, written by proton (Emech's coder)
+/* Oddly enough, written by Sup (former(?) Eggdrop coder)
  */
 int isowner(char *name)
 {
-  char *pa, *pb;
-  char nl, pl;
+  register char *ptr = NULL, *s = NULL, *n = NULL;
 
-  if (!owner || !*owner)
+  if (!owner || !name)
     return 0;
 
-  if (!name || !*name)
-    return 0;
+  ptr = owner - 1;
 
-  nl = strlen(name);
-  pa = owner;
-  pb = owner;
-  while (1) {
-    while (1) {
-      if ((*pb == 0) || (*pb == ',') || (*pb == ' '))
-        break;
-      pb++;
-    }
-    pl = (unsigned int) pb - (unsigned int) pa;
-    if (pl == nl && !egg_strncasecmp(pa, name, nl))
-      return 1;
-    while (1) {
-      if ((*pb == 0) || ((*pb != ',') && (*pb != ' ')))
-        break;
-      pb++;
+  do {
+    ptr++;
+    if (*ptr && !egg_isspace(*ptr) && *ptr != ',') {
+      if (!s)
+        s = ptr;
+    } else if (s) {
+      for (n = name; *n && *s && s < ptr && tolower(*n) == tolower(*s); n++, s++);
+
+      if (s == ptr && !*n)
+        return 1;
+
+      s = NULL;
     }
-    if (*pb == 0)
-      return 0;
-    pa = pb;
-  }
+  } while (*ptr);
+
+  return 0;
 }
Index: eggdrop1.6/src/patch.h
diff -u eggdrop1.6/src/patch.h:1.1063 eggdrop1.6/src/patch.h:1.1064
--- eggdrop1.6/src/patch.h:1.1063	Tue Apr  6 01:50:11 2004
+++ eggdrop1.6/src/patch.h	Tue Apr  6 02:15:18 2004
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.1063 2004/04/06 06:50:11 wcc Exp $
+ * $Id: patch.h,v 1.1064 2004/04/06 07:15:18 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1081234203");            /* current unixtime */
+patch("1081235686");            /* current unixtime */
 /*
  *
  *
  */
-patch("compiledocs");
+patch("isowner-rewrite");
 /*
  *
  *
----------------------- End of diff -----------------------



More information about the Changes mailing list