return trigger->trigger;
}
-static void handle_command_async(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, struct ChanNode *sent_chan struct cmd_binding *cbind, char **argv, int argc);
+static void handle_command_async(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, struct ChanNode *sent_chan, struct cmd_binding *cbind, char **argv, int argc);
static USERAUTH_CALLBACK(command_checked_auth) {
struct command_check_user_cache *cache = data;
tmp_text_client = cache->textclient;
- handle_command_async(cache->client, user, cache->chan, cache->sent_chan, cache->cbind, cache->argv, cache->argc)
+ handle_command_async(cache->client, user, cache->chan, cache->sent_chan, cache->cbind, cache->argv, cache->argc);
free(cache->message);
free(cache);
}
int access_pos = 0;
int access_count = 0;
int minaccess = 0;
- char *str_a, *str_b = cbind->func->channel_access;
+ char *str_a, *str_b = cbind->func->channel_access, *str_c;
if(cbind->flags & CMDFLAG_OVERRIDE_CHANNEL_ACCESS)
str_b = cbind->channel_access;
if(str_b) {
- while((str_a = strstr(str_b, ","))) {
- *str_a = '\0';
- if(*str_b[0] == '#') {
- access_pos += sprintf(access_list+access_pos, ", `%s`", str_b);
+ str_c = strdup(str_b);
+ str_b = str_c;
+ while((str_a = str_b)) {
+ str_b = strstr(str_a, ",");
+ if(str_b) {
+ *str_b = '\0';
+ str_b++;
+ }
+ if(*str_a == '#') {
+ str_a++;
+ access_pos += sprintf(access_list+access_pos, ", `%s`", str_a);
access_count++;
} else {
- if(atoi(str_b) > minaccess)
- minaccess = atoi(str_b);
+ if(atoi(str_a) > minaccess)
+ minaccess = atoi(str_a);
}
- *str_a = ',';
- str_b = str_a+1;
}
- access_pos += sprintf(access_list+access_pos, ", `%s`", str_b);
- access_count++;
+ free(str_c);
} else
access_list[0] = '\0';
if(!(chan->flags & CHANFLAG_REQUESTED_CHANINFO) || (sent_chan && sent_chan == chan) || access_count || minaccess) {