From 23cd9521d48defbdcd1cb8585cae5d33980ccdbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Janouch?= Date: Sat, 9 Aug 2014 23:51:27 +0200 Subject: 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. --- src/common.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/common.c') 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. -- cgit v1.2.3