diff options
Diffstat (limited to 'kike.c')
-rw-r--r-- | kike.c | 34 |
1 files changed, 18 insertions, 16 deletions
@@ -1368,7 +1368,7 @@ irc_handle_cap (const struct irc_message *msg, struct client *c) if (msg->params.len > 1) { args.full_params = msg->params.vector[1]; - split_str_ignore_empty (args.full_params, ' ', &args.params); + cstr_split_ignore_empty (args.full_params, ' ', &args.params); } struct irc_cap_command *cmd = @@ -2151,7 +2151,7 @@ irc_handle_list (const struct irc_message *msg, struct client *c) { struct str_vector channels; str_vector_init (&channels); - split_str_ignore_empty (msg->params.vector[0], ',', &channels); + cstr_split_ignore_empty (msg->params.vector[0], ',', &channels); for (size_t i = 0; i < channels.len; i++) if ((chan = str_map_find (&c->ctx->channels, channels.vector[i])) && (!(chan->modes & IRC_CHAN_MODE_SECRET) @@ -2282,7 +2282,7 @@ irc_handle_names (const struct irc_message *msg, struct client *c) { struct str_vector channels; str_vector_init (&channels); - split_str_ignore_empty (msg->params.vector[0], ',', &channels); + cstr_split_ignore_empty (msg->params.vector[0], ',', &channels); for (size_t i = 0; i < channels.len; i++) if ((chan = str_map_find (&c->ctx->channels, channels.vector[i])) && (!(chan->modes & IRC_CHAN_MODE_SECRET) @@ -2445,7 +2445,7 @@ irc_handle_whois (const struct irc_message *msg, struct client *c) struct str_vector masks; str_vector_init (&masks); const char *masks_str = msg->params.vector[msg->params.len > 1]; - split_str_ignore_empty (masks_str, ',', &masks); + cstr_split_ignore_empty (masks_str, ',', &masks); for (size_t i = 0; i < masks.len; i++) { const char *mask = masks.vector[i]; @@ -2486,7 +2486,7 @@ irc_handle_whowas (const struct irc_message *msg, struct client *c) struct str_vector nicks; str_vector_init (&nicks); - split_str_ignore_empty (msg->params.vector[0], ',', &nicks); + cstr_split_ignore_empty (msg->params.vector[0], ',', &nicks); for (size_t i = 0; i < nicks.len; i++) { @@ -2607,7 +2607,7 @@ irc_handle_part (const struct irc_message *msg, struct client *c) const char *reason = msg->params.len > 1 ? msg->params.vector[1] : NULL; struct str_vector channels; str_vector_init (&channels); - split_str_ignore_empty (msg->params.vector[0], ',', &channels); + cstr_split_ignore_empty (msg->params.vector[0], ',', &channels); for (size_t i = 0; i < channels.len; i++) irc_try_part (c, channels.vector[i], reason); str_vector_free (&channels); @@ -2658,8 +2658,8 @@ irc_handle_kick (const struct irc_message *msg, struct client *c) struct str_vector users; str_vector_init (&channels); str_vector_init (&users); - split_str_ignore_empty (msg->params.vector[0], ',', &channels); - split_str_ignore_empty (msg->params.vector[1], ',', &users); + cstr_split_ignore_empty (msg->params.vector[0], ',', &channels); + cstr_split_ignore_empty (msg->params.vector[1], ',', &users); if (channels.len == 1) for (size_t i = 0; i < users.len; i++) @@ -2787,9 +2787,9 @@ irc_handle_join (const struct irc_message *msg, struct client *c) struct str_vector keys; str_vector_init (&channels); str_vector_init (&keys); - split_str_ignore_empty (msg->params.vector[0], ',', &channels); + cstr_split_ignore_empty (msg->params.vector[0], ',', &channels); if (msg->params.len > 1) - split_str_ignore_empty (msg->params.vector[1], ',', &keys); + cstr_split_ignore_empty (msg->params.vector[1], ',', &keys); for (size_t i = 0; i < channels.len; i++) irc_try_join (c, channels.vector[i], @@ -3508,8 +3508,10 @@ irc_initialize_ssl (struct server_context *ctx, struct error **e) bool result = false; - char *cert_path = resolve_config_filename (ssl_cert); - char *key_path = resolve_config_filename (ssl_key); + char *cert_path = resolve_filename + (ssl_cert, resolve_relative_config_filename); + char *key_path = resolve_filename + (ssl_key, resolve_relative_config_filename); if (!cert_path) error_set (e, "%s: %s", "cannot open file", ssl_cert); else if (!key_path) @@ -3530,7 +3532,7 @@ irc_initialize_catalog (struct server_context *ctx, struct error **e) if (!catalog) return true; - char *path = resolve_config_filename (catalog); + char *path = resolve_filename (catalog, resolve_relative_config_filename); if (!path) { error_set (e, "%s: %s", "cannot open file", catalog); @@ -3556,7 +3558,7 @@ irc_initialize_motd (struct server_context *ctx, struct error **e) if (!motd) return true; - char *path = resolve_config_filename (motd); + char *path = resolve_filename (motd, resolve_relative_config_filename); if (!path) { error_set (e, "%s: %s", "cannot open file", motd); @@ -3608,7 +3610,7 @@ irc_parse_config (struct server_context *ctx, struct error **e) str_vector_init (&fingerprints); const char *operators = str_map_find (&ctx->config, "operators"); if (operators) - split_str_ignore_empty (operators, ',', &fingerprints); + cstr_split_ignore_empty (operators, ',', &fingerprints); for (size_t i = 0; i < fingerprints.len; i++) { const char *key = fingerprints.vector[i]; @@ -3814,7 +3816,7 @@ irc_setup_listen_fds (struct server_context *ctx, struct error **e) struct str_vector ports; str_vector_init (&ports); - split_str_ignore_empty (bind_port, ',', &ports); + cstr_split_ignore_empty (bind_port, ',', &ports); ctx->listen_fds = xcalloc (ports.len, sizeof *ctx->listen_fds); ctx->listen_events = xcalloc (ports.len, sizeof *ctx->listen_events); for (size_t i = 0; i < ports.len; i++) |