Changeset 54879ab for irc_commands.c


Ignore:
Timestamp:
2006-01-21T22:31:10Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
57c4fc0
Parents:
f73b969 (diff), f1d38f2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Added RESTART command (only for ForkDaemon mode) for easier upgrades.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc_commands.c

    rf73b969 r54879ab  
    573573        { "lilo",        1, NULL,                IRC_CMD_OPER_ONLY | IRC_CMD_TO_MASTER },
    574574        { "rehash",      0, irc_cmd_rehash,      IRC_CMD_OPER_ONLY },
     575        { "restart",     0, NULL,                IRC_CMD_OPER_ONLY | IRC_CMD_TO_MASTER },
    575576        { "kill",        2, NULL,                IRC_CMD_OPER_ONLY | IRC_CMD_TO_MASTER },
    576577        { NULL }
     
    579580void irc_exec( irc_t *irc, char *cmd[] )
    580581{       
    581         int i;
     582        int i, n_arg;
    582583       
    583584        if( !cmd[0] )
     
    587588                if( g_strcasecmp( irc_commands[i].command, cmd[0] ) == 0 )
    588589                {
     590                        /* There should be no typo in the next line: */
     591                        for( n_arg = 0; cmd[n_arg]; n_arg ++ ); n_arg --;
     592                       
    589593                        if( irc_commands[i].flags & IRC_CMD_PRE_LOGIN && irc->status >= USTATUS_LOGGED_IN )
    590594                        {
     
    599603                                irc_reply( irc, 481, ":Permission denied - You're not an IRC operator" );
    600604                        }
    601                         else if( !cmd[irc_commands[i].required_parameters] )
     605                        else if( n_arg < irc_commands[i].required_parameters )
    602606                        {
    603607                                irc_reply( irc, 461, "%s :Need more parameters", cmd[0] );
Note: See TracChangeset for help on using the changeset viewer.