summaryrefslogtreecommitdiff
path: root/src/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common.c')
-rw-r--r--src/common.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/common.c b/src/common.c
index 5e4b130..782572d 100644
--- a/src/common.c
+++ b/src/common.c
@@ -1815,6 +1815,17 @@ irc_strcmp (const char *a, const char *b)
return 0;
}
+static int
+irc_fnmatch (const char *pattern, const char *string)
+{
+ size_t pattern_size = strlen (pattern) + 1;
+ size_t string_size = strlen (string) + 1;
+ char x_pattern[pattern_size], x_string[string_size];
+ irc_strxfrm (x_pattern, pattern, pattern_size);
+ irc_strxfrm (x_string, string, string_size);
+ return fnmatch (x_pattern, x_string, 0);
+}
+
// --- Configuration -----------------------------------------------------------
// The keys are stripped of surrounding whitespace, the values are not.