/[svn]/ircd-hybrid-7.2/src/ircd_parser.y
ViewVC logotype

Diff of /ircd-hybrid-7.2/src/ircd_parser.y

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 670 by michael, Thu Jun 1 10:53:00 2006 UTC revision 671 by michael, Tue Jun 13 07:15:38 2006 UTC
# Line 1548  class_entry: CLASS Line 1548  class_entry: CLASS
1548    if (ypass == 1)    if (ypass == 1)
1549    {    {
1550      yy_conf = make_conf_item(CLASS_TYPE);      yy_conf = make_conf_item(CLASS_TYPE);
1551      yy_class = (struct ClassItem *)map_to_conf(yy_conf);      yy_class = map_to_conf(yy_conf);
1552    }    }
1553  } class_name_b '{' class_items '}' ';'  } class_name_b '{' class_items '}' ';'
1554  {  {
1555    if (ypass == 1)    if (ypass == 1)
1556    {    {
1557      struct ConfItem *cconf;      struct ConfItem *cconf = NULL;
1558      struct ClassItem *class = NULL;      struct ClassItem *class = NULL;
1559    
1560      if (yy_class_name == NULL)      if (yy_class_name == NULL)
     {  
1561        delete_conf_item(yy_conf);        delete_conf_item(yy_conf);
     }  
1562      else      else
1563      {      {
1564        cconf = find_exact_name_conf(CLASS_TYPE, yy_class_name, NULL, NULL);        cconf = find_exact_name_conf(CLASS_TYPE, yy_class_name, NULL, NULL);
1565    
1566        if (cconf != NULL)                /* The class existed already */        if (cconf != NULL)                /* The class existed already */
1567        {        {
1568            int user_count = 0;
1569    
1570          rebuild_cidr_class(cconf, yy_class);          rebuild_cidr_class(cconf, yy_class);
1571          class = (struct ClassItem *) map_to_conf(cconf);  
1572          *class = *yy_class;          class = map_to_conf(cconf);
1573    
1574            user_count = class->curr_user_count;
1575            memcpy(class, yy_class, sizeof(*class));
1576            class->curr_user_count = user_count;
1577            class->active = 1;
1578    
1579          delete_conf_item(yy_conf);          delete_conf_item(yy_conf);
1580    
1581          MyFree(cconf->name);            /* Allows case change of class name */          MyFree(cconf->name);            /* Allows case change of class name */
# Line 1579  class_entry: CLASS Line 1585  class_entry: CLASS
1585        {        {
1586          MyFree(yy_conf->name);          /* just in case it was allocated */          MyFree(yy_conf->name);          /* just in case it was allocated */
1587          yy_conf->name = yy_class_name;          yy_conf->name = yy_class_name;
1588            yy_class->active = 1;
1589        }        }
1590      }      }
1591    
1592      yy_class_name = NULL;      yy_class_name = NULL;
1593    }    }
1594  };  };

Legend:
Removed from v.670  
changed lines
  Added in v.671

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28