Changeset 07054a5
- Timestamp:
- 2008-08-31T22:49:32Z (16 years ago)
- Branches:
- master
- Children:
- c1333754
- Parents:
- 3b99524
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
root_commands.c
r3b99524 r07054a5 81 81 do \ 82 82 { \ 83 int i;\84 for( i = 1; i <= x; i ++ )\85 if( cmd[ i] == NULL )\83 int blaat; \ 84 for( blaat = 0; blaat <= x; blaat ++ ) \ 85 if( cmd[blaat] == NULL ) \ 86 86 { \ 87 87 irc_usermsg( irc, "Not enough parameters given (need %d).", x ); \ … … 1008 1008 if( g_strcasecmp( cmd[1], "add" ) == 0 ) 1009 1009 { 1010 MIN_ARGS( 4 ); 1010 char *channel, *s; 1011 1012 MIN_ARGS( 3 ); 1011 1013 1012 1014 if( !( acc = account_get( irc, cmd[2] ) ) ) … … 1016 1018 } 1017 1019 1018 if( ( c = chat_add( irc, acc, cmd[3], cmd[4] ) ) ) 1020 if( cmd[4] == NULL ) 1021 { 1022 channel = g_strdup( cmd[3] ); 1023 if( ( s = strchr( channel, '@' ) ) ) 1024 *s = 0; 1025 } 1026 else 1027 { 1028 channel = g_strdup( cmd[4] ); 1029 } 1030 1031 if( strchr( CTYPES, channel[0] ) == NULL ) 1032 { 1033 s = g_strdup_printf( "%c%s", CTYPES[0], channel ); 1034 g_free( channel ); 1035 channel = s; 1036 } 1037 1038 if( ( c = chat_add( irc, acc, cmd[3], channel ) ) ) 1019 1039 irc_usermsg( irc, "Chatroom added successfully." ); 1020 1040 else 1021 1041 irc_usermsg( irc, "Could not add chatroom." ); 1042 1043 g_free( channel ); 1022 1044 } 1023 1045 else if( g_strcasecmp( cmd[1], "list" ) == 0 )
Note: See TracChangeset
for help on using the changeset viewer.