Committer  : entrope
CVSROOT    : /cvsroot/undernet-ircu
Module     : ircu2.10
Commit time: 2006-12-08 01:56:33 UTC

Modified files:
     ChangeLog ircd/crule.c ircd/ircd_lexer.l

Log message:

Fix bugs unearthed in testing of listener ipv4/ipv6 selection.

---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.823 ircu2.10/ChangeLog:1.824
--- ircu2.10/ChangeLog:1.823    Thu Dec  7 17:39:21 2006
+++ ircu2.10/ChangeLog  Thu Dec  7 17:56:23 2006
@@ -1,5 +1,14 @@
 2006-12-07  Michael Poole <[EMAIL PROTECTED]>
 
+       * ircd/crule.c (crule_free): Move decrement so that MyFree() may
+       continue to evaluate its argument twice (bleh).
+       (crule_cat): Properly set terminal byte for compound expressions.
+       
+       * ircd/ircd_lexer.l (init_lexer): Remove extraneous yy_init = 1.
+       (<<EOF>>): Add yy_init = 0; to force flex to re-init on rehash.
+
+2006-12-07  Michael Poole <[EMAIL PROTECTED]>
+
        * ircd/listener.c (show_ports): Update to show '4' and/or '6' as
        flags in response, with a '-' suffix if either one fails to open.
 
Index: ircu2.10/ircd/crule.c
diff -u ircu2.10/ircd/crule.c:1.12 ircu2.10/ircd/crule.c:1.13
--- ircu2.10/ircd/crule.c:1.12  Wed Jul 26 18:06:46 2006
+++ ircu2.10/ircd/crule.c       Thu Dec  7 17:56:23 2006
@@ -1,7 +1,7 @@
 /**
  * @file
  * @brief Connection rule parser and checker
- * @version $Id: crule.c,v 1.12 2006/07/27 01:06:46 entrope Exp $
+ * @version $Id: crule.c,v 1.13 2006/12/08 01:56:23 entrope Exp $
  *
  * by Tony Vencill (Tonto on IRC) <[EMAIL PROTECTED]>
  * rewritten by Michael Poole <[EMAIL PROTECTED]>
@@ -202,8 +202,8 @@
   }
   else
   {
-    while (elem->numargs)
-      MyFree(elem->arg[--elem->numargs]);
+    while (elem->numargs--)
+      MyFree(elem->arg[elem->numargs]);
   }
   MyFree(elem);
 }
@@ -279,6 +279,7 @@
     used += crule_cat(rule->arg[1], buf + used, (remain < used) ? 0 : remain - 
used);
     if (remain > used++)
       buf[used - 1] = ')';
+    buf[used] = '\0';
     return used;
   } else if (rule->funcptr == crule_not) {
     if (remain)
Index: ircu2.10/ircd/ircd_lexer.l
diff -u ircu2.10/ircd/ircd_lexer.l:1.29 ircu2.10/ircd/ircd_lexer.l:1.30
--- ircu2.10/ircd/ircd_lexer.l:1.29     Thu Dec  7 17:39:22 2006
+++ ircu2.10/ircd/ircd_lexer.l  Thu Dec  7 17:56:23 2006
@@ -17,7 +17,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  *  USA.
- * $Id: ircd_lexer.l,v 1.29 2006/12/08 01:39:22 entrope Exp $
+ * $Id: ircd_lexer.l,v 1.30 2006/12/08 01:56:23 entrope Exp $
  */
 
 %option never-interactive case-insensitive warn nodefault nounput yylineno
@@ -40,7 +40,6 @@
     fprintf(stderr, "Could not open the configuration file.");
     return 0;
   }
-  yy_init = 1;
   return 1;
 }
 
@@ -71,7 +70,7 @@
 [0-9]+         {yylval.num = strtoul(yytext, NULL, 10); return NUMBER;}
 [ \t\r\n]+     ;
 #.*            ;
-<<EOF>>                { yypop_buffer_state(); if (YY_CURRENT_BUFFER) return 
TEOF; else yyterminate(); }
+<<EOF>>                { yypop_buffer_state(); if (YY_CURRENT_BUFFER) return 
TEOF; else { yy_init = 0; yyterminate(); } }
 
 \&\&            return LOGICAL_AND;
 \|\|            return LOGICAL_OR;
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches

Reply via email to