summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/irc_string.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/irc_string.c b/src/irc_string.c
index a25aa86..1dd1ba7 100644
--- a/src/irc_string.c
+++ b/src/irc_string.c
@@ -28,13 +28,20 @@
int
-has_wildcards(const char *s)
+has_wildcards(const char *str)
{
- char c;
+ const unsigned char *p = (const unsigned char *)str;
- while ((c = *s++))
- if (IsMWildChar(c))
+ for (; *p; ++p)
+ {
+ if (*p == '\\')
+ {
+ if (*++p == '\0')
+ return 0;
+ }
+ else if (IsMWildChar(*p))
return 1;
+ }
return 0;
}