[cvslog] (2003-01-21 00:53:38 UTC) Module eggdrop1.6: Change committed

cvslog cvs at tsss.org
Mon Jan 20 18:54:01 CST 2003


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2003-01-21 00:53:38 UTC
Commited by: Will Buckner <wcc at techmonkeys.org>

Modified files:
     doc/UPDATES1.6 src/main.c src/misc.c src/patch.h src/tcl.c
     src/tclhash.c src/mod/channels.mod/channels.c
     src/mod/filesys.mod/dbcompat.c src/mod/irc.mod/chan.c
     src/mod/irc.mod/msgcmds.c src/mod/server.mod/server.c
     src/mod/server.mod/servmsg.c src/mod/uptime.mod/uptime.h
     src/mod/wire.mod/wire.c

Log message:

* Misc bugfixes and code cleanups. Patch by Matyas Koszik.

---------------------- diff included ----------------------
Index: eggdrop1.6/doc/UPDATES1.6
diff -u eggdrop1.6/doc/UPDATES1.6:1.446 eggdrop1.6/doc/UPDATES1.6:1.447
--- eggdrop1.6/doc/UPDATES1.6:1.446	Mon Jan 20 18:11:29 2003
+++ eggdrop1.6/doc/UPDATES1.6	Mon Jan 20 18:53:27 2003
@@ -1,10 +1,11 @@
-$Id: UPDATES1.6,v 1.446 2003/01/21 00:11:29 wcc Exp $
+$Id: UPDATES1.6,v 1.447 2003/01/21 00:53:27 wcc Exp $
 
 Changes in Eggdrop: (since v1.6.0)
 ----------------------------------
 
 1.6.14
 Found by  Fixed by  What...
+          M. Koszik several misc code cleanups and bugfixes
           Wcc       files copied to /tmp from file transfers are now deleted
                     if the transfer connection is killed (makes resends and
                     resumes function correctly)
Index: eggdrop1.6/src/main.c
diff -u eggdrop1.6/src/main.c:1.90 eggdrop1.6/src/main.c:1.91
--- eggdrop1.6/src/main.c:1.90	Mon Dec 23 20:30:04 2002
+++ eggdrop1.6/src/main.c	Mon Jan 20 18:53:27 2003
@@ -5,7 +5,7 @@
  *   command line arguments
  *   context and assert debugging
  *
- * $Id: main.c,v 1.90 2002/12/24 02:30:04 wcc Exp $
+ * $Id: main.c,v 1.91 2003/01/21 00:53:27 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -1001,7 +1001,7 @@
     } else if (xx == -2 && errno != EINTR) {	/* select() error */
       putlog(LOG_MISC, "*", "* Socket error #%d; recovering.", errno);
       for (i = 0; i < dcc_total; i++) {
-	if ((fcntl(dcc[i].sock, F_GETFD, 0) == -1) && (errno = EBADF)) {
+	if ((fcntl(dcc[i].sock, F_GETFD, 0) == -1) && (errno == EBADF)) {
 	  putlog(LOG_MISC, "*",
 		 "DCC socket %d (type %d, name '%s') expired -- pfft",
 		 dcc[i].sock, dcc[i].type, dcc[i].nick);
Index: eggdrop1.6/src/misc.c
diff -u eggdrop1.6/src/misc.c:1.55 eggdrop1.6/src/misc.c:1.56
--- eggdrop1.6/src/misc.c:1.55	Fri Jan 17 22:34:25 2003
+++ eggdrop1.6/src/misc.c	Mon Jan 20 18:53:27 2003
@@ -7,7 +7,7 @@
  *   help system
  *   motd display and %var substitution
  *
- * $Id: misc.c,v 1.55 2003/01/18 04:34:25 wcc Exp $
+ * $Id: misc.c,v 1.56 2003/01/21 00:53:27 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -1455,7 +1455,7 @@
   char		 buf[3];
   register char	*s, *p;
 
-  buf[3] = 0;
+  buf[2] = 0;
   for (s = p = str; *s; s++, p++) {
     if (*s == esc_char) {	/* Found escape character.		*/
       /* Convert code to character. */
Index: eggdrop1.6/src/mod/channels.mod/channels.c
diff -u eggdrop1.6/src/mod/channels.mod/channels.c:1.75 eggdrop1.6/src/mod/channels.mod/channels.c:1.76
--- eggdrop1.6/src/mod/channels.mod/channels.c:1.75	Fri Dec 27 14:27:40 2002
+++ eggdrop1.6/src/mod/channels.mod/channels.c	Mon Jan 20 18:53:27 2003
@@ -2,7 +2,7 @@
  * channels.c -- part of channels.mod
  *   support for channels within the bot
  *
- * $Id: channels.c,v 1.75 2002/12/27 20:27:40 wcc Exp $
+ * $Id: channels.c,v 1.76 2003/01/21 00:53:27 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -177,11 +177,10 @@
 static void get_mode_protect(struct chanset_t *chan, char *s)
 {
   char *p = s, s1[121];
-  int ok = 0, i, tst;
+  int i, tst;
 
   s1[0] = 0;
   for (i = 0; i < 2; i++) {
-    ok = 0;
     if (i == 0) {
       tst = chan->mode_pls_prot;
       if ((tst) || (chan->limit_prot != 0) || (chan->key_prot[0]))
Index: eggdrop1.6/src/mod/filesys.mod/dbcompat.c
diff -u eggdrop1.6/src/mod/filesys.mod/dbcompat.c:1.12 eggdrop1.6/src/mod/filesys.mod/dbcompat.c:1.13
--- eggdrop1.6/src/mod/filesys.mod/dbcompat.c:1.12	Mon Dec 23 20:30:07 2002
+++ eggdrop1.6/src/mod/filesys.mod/dbcompat.c	Mon Jan 20 18:53:27 2003
@@ -4,7 +4,7 @@
  *
  * Written for filedb3 by Fabian Knittel <fknittel at gmx.de>
  *
- * $Id: dbcompat.c,v 1.12 2002/12/24 02:30:07 wcc Exp $
+ * $Id: dbcompat.c,v 1.13 2003/01/21 00:53:27 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -147,12 +147,10 @@
  */
 static void convert_version1(FILE *fdb_s, FILE *fdb_t)
 {
-  long where;
   filedb1 fdb1;
 
   fseek(fdb_s, 0L, SEEK_SET);
   while (!feof(fdb_s)) {
-    where = ftell(fdb_s);
     fread(&fdb1, sizeof(filedb1), 1, fdb_s);
     if (!feof(fdb_s)) {
       if (!(fdb1.stat & FILE_UNUSED)) {
@@ -184,12 +182,10 @@
  */
 static void convert_version2(FILE *fdb_s, FILE *fdb_t)
 {
-  long where;
   filedb2 fdb2;
 
   fseek(fdb_s, 0L, SEEK_SET);
   while (!feof(fdb_s)) {
-    where = ftell(fdb_s);
     fread(&fdb2, sizeof(filedb2), 1, fdb_s);
     if (!feof(fdb_s)) {
       if (!(fdb2.stat & FILE_UNUSED)) {
Index: eggdrop1.6/src/mod/irc.mod/chan.c
diff -u eggdrop1.6/src/mod/irc.mod/chan.c:1.103 eggdrop1.6/src/mod/irc.mod/chan.c:1.104
--- eggdrop1.6/src/mod/irc.mod/chan.c:1.103	Tue Jan 14 18:35:01 2003
+++ eggdrop1.6/src/mod/irc.mod/chan.c	Mon Jan 20 18:53:27 2003
@@ -6,7 +6,7 @@
  *   user kickban, kick, op, deop
  *   idle kicking
  *
- * $Id: chan.c,v 1.103 2003/01/15 00:35:01 wcc Exp $
+ * $Id: chan.c,v 1.104 2003/01/21 00:53:27 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -231,8 +231,8 @@
       return 0;
   }
   if (rfc_casecmp(chan->floodwho[which], p)) {	/* new */
-    strncpy(chan->floodwho[which], p, 81);
-    chan->floodwho[which][81] = 0;
+    strncpy(chan->floodwho[which], p, 80);
+    chan->floodwho[which][80] = 0;
     chan->floodtime[which] = now;
     chan->floodnum[which] = 1;
     return 0;
Index: eggdrop1.6/src/mod/irc.mod/msgcmds.c
diff -u eggdrop1.6/src/mod/irc.mod/msgcmds.c:1.34 eggdrop1.6/src/mod/irc.mod/msgcmds.c:1.35
--- eggdrop1.6/src/mod/irc.mod/msgcmds.c:1.34	Mon Dec 23 20:30:08 2002
+++ eggdrop1.6/src/mod/irc.mod/msgcmds.c	Mon Jan 20 18:53:27 2003
@@ -2,7 +2,7 @@
  * msgcmds.c -- part of irc.mod
  *   all commands entered via /MSG
  *
- * $Id: msgcmds.c,v 1.34 2002/12/24 02:30:08 wcc Exp $
+ * $Id: msgcmds.c,v 1.35 2003/01/21 00:53:27 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -30,7 +30,6 @@
   int common = 0;
   int atr = 0;
   struct chanset_t *chan;
-  struct flag_record fr = {FR_GLOBAL, 0, 0, 0, 0, 0};
 
   if (!learn_users && !make_userfile)
     return 0;
@@ -44,9 +43,6 @@
   }
   strncpyz(handle, nick, sizeof(handle));
   if (get_user_by_handle(userlist, handle)) {
-    struct flag_record fr = {FR_GLOBAL, 0, 0, 0, 0, 0};
-    fr.global = atr;
-
     dprintf(DP_HELP, IRC_BADHOST1, nick);
     dprintf(DP_HELP, IRC_BADHOST2, nick, botname);
     return 1;
@@ -86,8 +82,6 @@
     dprintf(DP_HELP, "NOTICE %s :%s\n", nick, IRC_SALUT2B);
   }
   if (make_userfile) {
-    fr.global = sanity_check(default_flags | USER_OWNER);
-
     dprintf(DP_HELP, "NOTICE %s :%s\n", nick, IRC_INITOWNER1);
     dprintf(DP_HELP, IRC_NEWBOT1, nick, botname);
     dprintf(DP_HELP, IRC_NEWBOT2, nick);
@@ -96,8 +90,6 @@
     write_userfile(-1);
     add_note(handle, botnetnick, IRC_INITNOTE, -1, 0);
   } else {
-    fr.global = default_flags;
-
     dprintf(DP_HELP, IRC_INTRO1, nick, botname);
   }
   if (strlen(nick) > HANDLEN)
Index: eggdrop1.6/src/mod/server.mod/server.c
diff -u eggdrop1.6/src/mod/server.mod/server.c:1.86 eggdrop1.6/src/mod/server.mod/server.c:1.87
--- eggdrop1.6/src/mod/server.mod/server.c:1.86	Tue Jan 14 19:03:05 2003
+++ eggdrop1.6/src/mod/server.mod/server.c	Mon Jan 20 18:53:27 2003
@@ -2,7 +2,7 @@
  * server.c -- part of server.mod
  *   basic irc server support
  *
- * $Id: server.c,v 1.86 2003/01/15 01:03:05 wcc Exp $
+ * $Id: server.c,v 1.87 2003/01/21 00:53:27 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -32,7 +32,6 @@
 
 static int ctcp_mode;
 static int serv;		/* sock # of server currently */
-static int strict_host;		/* strict masking of hosts ? */
 static char newserver[121];	/* new server? */
 static int newserverport;	/* new server port? */
 static char newserverpass[121];	/* new server password? */
@@ -1878,7 +1877,6 @@
    * globally.
    */
   serv = -1;
-  strict_host = 1;
   botname[0] = 0;
   trying_server = 0L;
   server_lag = 0;
Index: eggdrop1.6/src/mod/server.mod/servmsg.c
diff -u eggdrop1.6/src/mod/server.mod/servmsg.c:1.67 eggdrop1.6/src/mod/server.mod/servmsg.c:1.68
--- eggdrop1.6/src/mod/server.mod/servmsg.c:1.67	Tue Jan 14 19:03:05 2003
+++ eggdrop1.6/src/mod/server.mod/servmsg.c	Mon Jan 20 18:53:27 2003
@@ -1,7 +1,7 @@
 /*
  * servmsg.c -- part of server.mod
  *
- * $Id: servmsg.c,v 1.67 2003/01/15 01:03:05 wcc Exp $
+ * $Id: servmsg.c,v 1.68 2003/01/21 00:53:27 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -889,9 +889,7 @@
 static int gotnick(char *from, char *msg)
 {
   char *nick, *alt = get_altbotnick();
-  struct userrec *u;
 
-  u = get_user_by_host(from);
   nick = splitnick(&from);
   fixcolon(msg);
   check_queues(nick, msg);
Index: eggdrop1.6/src/mod/uptime.mod/uptime.h
diff -u eggdrop1.6/src/mod/uptime.mod/uptime.h:1.9 eggdrop1.6/src/mod/uptime.mod/uptime.h:1.10
--- eggdrop1.6/src/mod/uptime.mod/uptime.h:1.9	Mon Dec 23 20:30:09 2002
+++ eggdrop1.6/src/mod/uptime.mod/uptime.h	Mon Jan 20 18:53:27 2003
@@ -1,7 +1,7 @@
 /*
  * uptime.h - part of the uptime module
  *
- * $Id: uptime.h,v 1.9 2002/12/24 02:30:09 wcc Exp $
+ * $Id: uptime.h,v 1.10 2003/01/21 00:53:27 wcc Exp $
  */
 /*
  * Copyright (C) 2001 proton
@@ -25,8 +25,8 @@
 #ifndef _EGG_MOD_UPTIME_UPTIME_H
 #define _EGG_MOD_UPTIME_UPTIME_H
 
-const static int uptime_type = 2;
-const static int uptime_port = 9969;
-const static char *uptime_host = "uptime.eggheads.org";
+static const int uptime_type = 2;
+static const int uptime_port = 9969;
+static const char *uptime_host = "uptime.eggheads.org";
 
 #endif /* _EGG_MOD_UPTIME_UPTIME_H */
Index: eggdrop1.6/src/mod/wire.mod/wire.c
diff -u eggdrop1.6/src/mod/wire.mod/wire.c:1.23 eggdrop1.6/src/mod/wire.mod/wire.c:1.24
--- eggdrop1.6/src/mod/wire.mod/wire.c:1.23	Mon Dec 23 20:30:09 2002
+++ eggdrop1.6/src/mod/wire.mod/wire.c	Mon Jan 20 18:53:27 2003
@@ -15,7 +15,7 @@
  * 1.4       1997-11-25      1.2.2.0         Added language addition  Kirk
  * 1.5       1998-07-12      1.3.0.0         Fixed ;me and updated    BB
  *
- * $Id: wire.c,v 1.23 2002/12/24 02:30:09 wcc Exp $
+ * $Id: wire.c,v 1.24 2003/01/21 00:53:27 wcc Exp $
  */
 /*
  * Copyright (C) 1999, 2000, 2001, 2002, 2003 Eggheads Development Team
@@ -125,11 +125,11 @@
 	  mins = ((now2 - dcc[idx].timeval) -
 		  (hrs * 3600)) / 60;
 	  if (Days > 0)
-	    sprintf(idle, " \[%s %lud%luh]", WIRE_IDLE, Days, hrs);
+	    sprintf(idle, " [%s %lud%luh]", WIRE_IDLE, Days, hrs);
 	  else if (hrs > 0)
-	    sprintf(idle, " \[%s %luh%lum]", WIRE_IDLE, hrs, mins);
+	    sprintf(idle, " [%s %luh%lum]", WIRE_IDLE, hrs, mins);
 	  else
-	    sprintf(idle, " \[%s %lum]", WIRE_IDLE, mins);
+	    sprintf(idle, " [%s %lum]", WIRE_IDLE, mins);
 	} else
 	  idle[0] = 0;
 	sprintf(wirereq, "----- %c%-9s %-9s  %s%s",
@@ -254,11 +254,11 @@
 	hrs = ((now2 - dcc[idx2].timeval) - (Days * 86400)) / 3600;
 	mins = ((now2 - dcc[idx2].timeval) - (hrs * 3600)) / 60;
 	if (Days > 0)
-	  sprintf(idle, " \[%s %lud%luh]", WIRE_IDLE, Days, hrs);
+	  sprintf(idle, " [%s %lud%luh]", WIRE_IDLE, Days, hrs);
 	else if (hrs > 0)
-	  sprintf(idle, " \[%s %luh%lum]", WIRE_IDLE, hrs, mins);
+	  sprintf(idle, " [%s %luh%lum]", WIRE_IDLE, hrs, mins);
 	else
-	  sprintf(idle, " \[%s %lum]", WIRE_IDLE, mins);
+	  sprintf(idle, " [%s %lum]", WIRE_IDLE, mins);
       } else
 	idle[0] = 0;
       dprintf(idx, "----- %c%-9s %-9s  %s%s\n",
@@ -591,7 +591,7 @@
 
 char *wire_start(Function * global_funcs)
 {
-  p_tcl_bind_list H_temp;
+  p_tcl_bind_list H_temp; /* variable "H_temp" was set but never used */
 
   global = global_funcs;
 
Index: eggdrop1.6/src/patch.h
diff -u eggdrop1.6/src/patch.h:1.876 eggdrop1.6/src/patch.h:1.877
--- eggdrop1.6/src/patch.h:1.876	Mon Jan 20 02:54:54 2003
+++ eggdrop1.6/src/patch.h	Mon Jan 20 18:53:27 2003
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.876 2003/01/20 08:54:54 wcc Exp $
+ * $Id: patch.h,v 1.877 2003/01/21 00:53:27 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1043052850");		/* current unixtime */
+patch("1043110018");		/* current unixtime */
 /*
  *
  *
  */
-patch("killtransfer-segv");
+patch("bugfixes");
 /*
  *
  *
Index: eggdrop1.6/src/tcl.c
diff -u eggdrop1.6/src/tcl.c:1.55 eggdrop1.6/src/tcl.c:1.56
--- eggdrop1.6/src/tcl.c:1.55	Mon Jan 20 18:11:29 2003
+++ eggdrop1.6/src/tcl.c	Mon Jan 20 18:53:27 2003
@@ -4,7 +4,7 @@
  *   Tcl initialization
  *   getting and setting Tcl/eggdrop variables
  *
- * $Id: tcl.c,v 1.55 2003/01/21 00:11:29 wcc Exp $
+ * $Id: tcl.c,v 1.56 2003/01/21 00:53:27 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -743,6 +743,7 @@
     tmp = protect_readonly;
     protect_readonly = 0;
     tcl_eggstr((ClientData) st, interp, list[i].name, NULL, TCL_TRACE_WRITES);
+    protect_readonly = tmp;
     tcl_eggstr((ClientData) st, interp, list[i].name, NULL, TCL_TRACE_READS);
     Tcl_TraceVar(interp, list[i].name, TCL_TRACE_READS | TCL_TRACE_WRITES |
 		 TCL_TRACE_UNSETS, tcl_eggstr, (ClientData) st);
Index: eggdrop1.6/src/tclhash.c
diff -u eggdrop1.6/src/tclhash.c:1.38 eggdrop1.6/src/tclhash.c:1.39
--- eggdrop1.6/src/tclhash.c:1.38	Wed Dec 25 20:21:53 2002
+++ eggdrop1.6/src/tclhash.c	Mon Jan 20 18:53:27 2003
@@ -7,7 +7,7 @@
  *   (non-Tcl) procedure lookups for msg/dcc/file commands
  *   (Tcl) binding internal procedures to msg/dcc/file commands
  *
- * $Id: tclhash.c,v 1.38 2002/12/26 02:21:53 wcc Exp $
+ * $Id: tclhash.c,v 1.39 2003/01/21 00:53:27 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -375,10 +375,10 @@
 			   const char *cmd, const char *proc)
 {
   tcl_cmd_t		*tc;
-  tcl_bind_mask_t	*tm, *tm_last;
+  tcl_bind_mask_t	*tm;
 
   /* Search for matching bind in bind list. */
-  for (tm = tl->first, tm_last = NULL; tm; tm_last = tm, tm = tm->next) {
+  for (tm = tl->first; tm; tm = tm->next) {
     if (tm->flags & TBM_DELETED)
       continue;
     if (!strcmp(cmd, tm->mask))
----------------------- End of diff -----------------------



More information about the Changes mailing list