summaryrefslogtreecommitdiff
path: root/src/resv.c
diff options
context:
space:
mode:
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2013-04-30 13:39:57 +0000
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2013-04-30 13:39:57 +0000
commit0ea643ad024cfb9adb6af2d76455f04708b2b8ed (patch)
tree0160305c055c8624abd33b00caebd503ff2cccb7 /src/resv.c
parent14eb53d8c74fcea96bae3b4a624151f52b90a704 (diff)
- Made valid_wild_card_simple() easier to read
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@1918 82007160-df01-0410-b94d-b575c5fd34c7
Diffstat (limited to 'src/resv.c')
-rw-r--r--src/resv.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/resv.c b/src/resv.c
index 99861f9..ba208c8 100644
--- a/src/resv.c
+++ b/src/resv.c
@@ -228,15 +228,22 @@ int
valid_wild_card_simple(const char *data)
{
const unsigned char *p = (const unsigned char *)data;
+ unsigned char tmpch = '\0';
int nonwild = 0;
- while (*p != '\0')
+ while ((tmpch = *p++))
{
- if ((*p == '\\' && *++p) || (*p && !IsMWildChar(*p)))
- if (++nonwild == ConfigFileEntry.min_nonwildcard_simple)
- return 1;
- if (*p != '\0')
+ if (tmpch == '\\')
+ {
++p;
+ if (++nonwild >= ConfigFileEntry.min_nonwildcard_simple)
+ return 1;
+ }
+ else if (!IsMWildChar(tmpch))
+ {
+ if (++nonwild >= ConfigFileEntry.min_nonwildcard_simple)
+ return 1;
+ }
}
return 0;