[eggheads-patches] PATCH: stripfix.patch

Peter 'Rattacresh' Backes rtc at rhrk.uni-kl.de
Fri Oct 8 19:50:17 CST 1999


I resend this patch now so the CVS admin's won't forget it the next 
time again.


-- Peter 'Rattacresh' Backes, rtc at rhrk.uni-kl.de

-------------- next part --------------
diff -urN eggdrop1.3.29/doc/UPDATES1.3 eggdrop1.3.29+stripfix/doc/UPDATES1.3
--- eggdrop1.3.29/doc/UPDATES1.3	Fri Oct  8 18:16:03 1999
+++ eggdrop1.3.29+stripfix/doc/UPDATES1.3	Fri Oct  8 18:16:57 1999
@@ -4,6 +4,7 @@
 
 1.3.29
 Foundby   Fixedby   What....
+          rtc       .strip didn't log the changes
           dw        kicks weren't being logged
           rtc       added assert debugging feature
 	  Fabian    main() wasn't removing unknown sockets correctly
diff -urN eggdrop1.3.29/src/cmds.c eggdrop1.3.29+stripfix/src/cmds.c
--- eggdrop1.3.29/src/cmds.c	Fri Oct  8 18:16:03 1999
+++ eggdrop1.3.29+stripfix/src/cmds.c	Fri Oct  8 18:14:22 1999
@@ -1898,7 +1898,7 @@
 
 static void cmd_strip(struct userrec *u, int idx, char *par)
 {
-  char *nick, *changes, s[2];
+  char *nick, *changes, *c, s[2];
   int dest = 0, i, pls, md, ok = 0;
   module_entry *me;
 
@@ -1927,11 +1927,12 @@
     nick = "";
     dest = idx;
   }
-  if ((changes[0] != '+') && (changes[0] != '-'))
+  c = changes;
+  if ((c[0] != '+') && (c[0] != '-'))
     dcc[dest].u.chat->strip_flags = 0;
   s[1] = 0;
-  for (pls = 1; *changes; changes++) {
-    switch (*changes) {
+  for (pls = 1; *c; c++) {
+    switch (*c) {
     case '+':
       pls = 1;
       break;
@@ -1939,7 +1940,7 @@
       pls = 0;
       break;
     default:
-      s[0] = *changes;
+      s[0] = *c;
       md = stripmodes(s);
       if (pls == 1)
 	dcc[dest].u.chat->strip_flags |= md;
@@ -1947,7 +1948,14 @@
 	dcc[dest].u.chat->strip_flags &= ~md;
     }
   }
-  putlog(LOG_CMDS, "*", "#%s# strip %s %s", dcc[idx].nick, nick, changes);
+  if (nick[0]) {
+    putlog(LOG_CMDS, "*", "#%s# strip %s %s", dcc[idx].nick, nick, changes);
+  } else {
+    putlog(LOG_CMDS, "*", "#%s# strip %s", dcc[idx].nick, changes);
+  }
+  /* This is a bit dirty but works, too: ++rtc */
+  /* putlog (LOG_CMDS, "*", nick[0] ? "#%s# strip %s %s" : "#%s# strip %s%s",
+    dcc[idx].nick, nick, changes); */
   if (dest == idx) {
     dprintf(idx, "Your strip settings are: %s (%s)\n",
 	    stripmasktype(dcc[idx].u.chat->strip_flags),


More information about the Patches mailing list