summaryrefslogtreecommitdiff
path: root/src/common.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2014-08-09 23:51:27 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2014-08-09 23:51:27 +0200
commit23cd9521d48defbdcd1cb8585cae5d33980ccdbb (patch)
tree1f2ab23a4a7fce9eecaca75ae395945b99218f22 /src/common.c
parent9927956104340dd459daebec49181936518972fa (diff)
downloadxK-23cd9521d48defbdcd1cb8585cae5d33980ccdbb.tar.gz
xK-23cd9521d48defbdcd1cb8585cae5d33980ccdbb.tar.xz
xK-23cd9521d48defbdcd1cb8585cae5d33980ccdbb.zip
kike: shuffle things around
Pseudorandomly. There are more than one way the program could be laid out. Some of them make more sense than others.
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.