1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-12 15:34:47 +02:00

Add const to third argument of unreal_create_match()

This commit is contained in:
Bram Matthys
2026-06-05 09:58:16 +02:00
parent f0c0feff4f
commit dee26e2e12
7 changed files with 13 additions and 10 deletions
+3
View File
@@ -22,6 +22,9 @@ This is work in progress and may not always be a stable version.
at 1MB like in 6.2.5 (`DOWNLOAD_MAX_SIZE_MEMORY_BACKED`).
* The `unreal_match()` function now has a 3rd argument `const char **error`
for communicating regex errors back. Just set to `NULL` if you don't care.
* Similarly, `unreal_create_match()` last argument is now `const char **error`
(const was added). So when callers use that, their variable `char *err`
needs to become `const char *err`.
* If you do something to a user that would (potentially) move the user from
`unknown-users` to `known-users` (or vice versa) then you should call
`update_known_user_cache(client);` to update the known users cache.
+1 -1
View File
@@ -1093,7 +1093,7 @@ extern int parse_chanmode(ParseMode *pm, const char *modebuf_in, const char *par
extern int dead_socket(Client *to, const char *notice);
extern MODVAR pcre2_match_context *unreal_pcre2_match_ctx;
extern void init_match(void);
extern Match *unreal_create_match(MatchType type, const char *str, char **error);
extern Match *unreal_create_match(MatchType type, const char *str, const char **error);
extern void unreal_delete_match(Match *m);
extern int unreal_match(Match *m, const char *str, const char **error);
extern int unreal_match_method_strtoval(const char *str);
+1 -1
View File
@@ -10624,7 +10624,7 @@ int _test_alias(ConfigFile *conf, ConfigEntry *ce) {
continue;
}
if (!strcmp(cep->name, "format")) {
char *err = NULL;
const char *err = NULL;
Match *expr;
char has_type = 0, has_target = 0, has_parameters = 0;
+1 -1
View File
@@ -397,7 +397,7 @@ void unreal_delete_match(Match *m)
safe_free(m);
}
Match *unreal_create_match(MatchType type, const char *str, char **error)
Match *unreal_create_match(MatchType type, const char *str, const char **error)
{
Match *m = safe_alloc(sizeof(Match));
static char errorbuf[512];
+1 -1
View File
@@ -210,7 +210,7 @@ RPC_CALL_FUNC(rpc_spamfilter_add)
char targetbuf[64];
char actionbuf[2];
char reasonbuf[512];
char *err = NULL;
const char *err = NULL;
if (!spamfilter_select_criteria(client, request, params, &name, &match_type, &targets, targetbuf, sizeof(targetbuf), &action, actionbuf))
return; /* Error already communicated to client */
+5 -5
View File
@@ -533,7 +533,7 @@ int tkl_config_test_spamfilter(ConfigFile *cf, ConfigEntry *ce, int type, int *e
if (match && match_type)
{
Match *m;
char *err;
const char *err;
m = unreal_create_match(match_type, match, &err);
if (!m)
@@ -733,7 +733,7 @@ int tkl_config_run_spamfilter(ConfigFile *cf, ConfigEntry *ce, int type)
if (match)
{
char *err;
const char *err;
m = unreal_create_match(match_type, match, &err);
if (!m)
{
@@ -1227,7 +1227,7 @@ void recompile_spamfilters(void)
{
TKL *tkl;
Match *m;
char *err;
const char *err;
int converted = 0;
int index;
@@ -2517,7 +2517,7 @@ CMD_FUNC(cmd_spamfilter)
int n;
Match *m;
int match_type = 0;
char *err = NULL;
const char *err = NULL;
if (IsServer(client))
return;
@@ -4741,7 +4741,7 @@ CMD_FUNC(cmd_tkl_add)
BanActionValue action;
unsigned short target;
/* helper variables */
char *err;
const char *err;
if (parc < 12)
{
+1 -1
View File
@@ -678,7 +678,7 @@ int read_tkldb(void)
if (TKLIsSpamfilter(tkl))
{
int match_method;
char *err = NULL;
const char *err = NULL;
tkl->ptr.spamfilter = safe_alloc(sizeof(Spamfilter));