diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-04-12 02:06:49 +0200 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-04-12 02:06:49 +0200 |
commit | 24b8bbb2616d685006a279e46a4bd2e8e7cf6694 (patch) | |
tree | c585d428a08bdd8c7f22b1fdef8e65d758f60d6e /root_commands.c | |
parent | e21c0f8b276cc3ca177bcf6217eba9c634d410f7 (diff) |
Start handling CTCPs, in a saner way than before.
Diffstat (limited to 'root_commands.c')
-rw-r--r-- | root_commands.c | 43 |
1 files changed, 1 insertions, 42 deletions
diff --git a/root_commands.c b/root_commands.c index 3853a73e..7a4c021e 100644 --- a/root_commands.c +++ b/root_commands.c @@ -33,48 +33,7 @@ void root_command_string( irc_t *irc, char *command ) { - char *cmd[IRC_MAX_ARGS]; - char *s; - int k; - char q = 0; - - memset( cmd, 0, sizeof( cmd ) ); - cmd[0] = command; - k = 1; - for( s = command; *s && k < ( IRC_MAX_ARGS - 1 ); s ++ ) - if( *s == ' ' && !q ) - { - *s = 0; - while( *++s == ' ' ); - if( *s == '"' || *s == '\'' ) - { - q = *s; - s ++; - } - if( *s ) - { - cmd[k++] = s; - s --; - } - else - { - break; - } - } - else if( *s == '\\' && ( ( !q && s[1] ) || ( q && q == s[1] ) ) ) - { - char *cpy; - - for( cpy = s; *cpy; cpy ++ ) - cpy[0] = cpy[1]; - } - else if( *s == q ) - { - q = *s = 0; - } - cmd[k] = NULL; - - root_command( irc, cmd ); + root_command( irc, split_command_parts( command ) ); } #define MIN_ARGS( x, y... ) \ |