Committer  : entrope
CVSROOT    : /cvsroot/undernet-ircu
Module     : ircu2.10
Branch tags: u2_10_12_branch
Commit time: 2007-11-17 14:21:12 UTC

Modified files:
  Tag: u2_10_12_branch
     ircd/m_stats.c ChangeLog

Log message:

Make "/stats flag server param" work as intended again.

---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.710.2.214 ircu2.10/ChangeLog:1.710.2.215
--- ircu2.10/ChangeLog:1.710.2.214      Sat Nov 17 06:12:37 2007
+++ ircu2.10/ChangeLog  Sat Nov 17 06:21:02 2007
@@ -1,5 +1,10 @@
 2007-11-17  Michael Poole <[EMAIL PROTECTED]>
 
+       * ircd/m_stats.c (m_stats): Properly assign param before it is
+       used in the hunt_server_cmd() call.
+       
+2007-11-17  Michael Poole <[EMAIL PROTECTED]>
+
        * ircd/s_auth.c (iauth_disconnect): Avoid destroying invalid
        sockets.
        (iauth_stderr_callback): Disconnect iauth child if stderr has
Index: ircu2.10/ircd/m_stats.c
diff -u ircu2.10/ircd/m_stats.c:1.31.2.3 ircu2.10/ircd/m_stats.c:1.31.2.4
--- ircu2.10/ircd/m_stats.c:1.31.2.3    Mon Mar 26 20:44:41 2007
+++ ircu2.10/ircd/m_stats.c     Sat Nov 17 06:21:02 2007
@@ -20,7 +20,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: m_stats.c,v 1.31.2.3 2007/03/27 03:44:41 entrope Exp $
+ * $Id: m_stats.c,v 1.31.2.4 2007/11/17 14:21:02 entrope Exp $
  */
 
 /*
@@ -119,7 +119,7 @@
 m_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 {
   const struct StatDesc *sd;
-  char *param = 0;
+  char *param;
 
   /* If we didn't find a descriptor, send them help */
   if ((parc < 2) || !(sd = stats_find(parv[1])))
@@ -140,6 +140,12 @@
        ((sd->sd_flags & STAT_FLAG_OPERFEAT) && feature_bool(sd->sd_control))))
     return send_reply(sptr, ERR_NOPRIVILEGES);
 
+  /* Check for extra parameter */
+  if ((sd->sd_flags & STAT_FLAG_VARPARAM) && parc > 3 && !EmptyString(parv[3]))
+    param = parv[3];
+  else
+    param = NULL;
+
   /* Ok, track down who's supposed to get this... */
   if (hunt_server_cmd(sptr, CMD_STATS, cptr, feature_int(FEAT_HIS_REMOTE),
                      param ? "%s %C :%s" : "%s :%C", 2, parc, parv) !=
@@ -150,10 +156,6 @@
   if ((sd->sd_flags & STAT_FLAG_LOCONLY) && !MyUser(sptr))
     return send_reply(sptr, ERR_NOPRIVILEGES);
 
-  /* Check for extra parameter */
-  if ((sd->sd_flags & STAT_FLAG_VARPARAM) && parc > 3 && !EmptyString(parv[3]))
-    param = parv[3];
-
   assert(sd->sd_func != 0);
 
   /* Ok, dispatch the stats function */
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches

Reply via email to