X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fcrule.c;h=a91aecb41b76021a64c7b5be61e1d4859b05a899;hb=46f401ef80a4bede99ed5034d03836f6e7ca6936;hp=316985d6ed5c209d64dff75f66fe0550a2c802aa;hpb=63c230d9f7562bda1fef7bfbb4e7b27c1647b490;p=ircu2.10.12-pk.git diff --git a/ircd/crule.c b/ircd/crule.c index 316985d..a91aecb 100644 --- a/ircd/crule.c +++ b/ircd/crule.c @@ -5,7 +5,7 @@ * * by Tony Vencill (Tonto on IRC) * - * The majority of this file is a recusive descent parser used to convert + * The majority of this file is a recursive descent parser used to convert * connection rules into expression trees when the conf file is read. * All parsing structures and types are hidden in the interest of good * programming style and to make possible future data structure changes @@ -85,7 +85,7 @@ strcpy(x,y); \ } while(0) -/* We don't care about collation discrepacies here, it seems.... */ +/* We don't care about collation discrepancies here, it seems.... */ #define ircd_strcmp strcasecmp #endif @@ -228,7 +228,7 @@ static int crule_connected(int numargs, void *crulearg[]) /* taken from m_links */ for (acptr = GlobalClientList; acptr; acptr = cli_next(acptr)) { - if (!IsServer(acptr) && !IsMe(acptr)) + if (!IsServer(acptr) || IsMe(acptr)) continue; if (match((char *)crulearg[0], cli_name(acptr))) continue; @@ -276,7 +276,7 @@ static int crule_via(int numargs, void *crulearg[]) /* adapted from m_links */ for (acptr = GlobalClientList; acptr; acptr = cli_next(acptr)) { - if (!IsServer(acptr) && !IsMe(acptr)) + if (!IsServer(acptr) || IsMe(acptr)) continue; if (match((char *)crulearg[1], cli_name(acptr))) continue; @@ -737,7 +737,7 @@ static int crule_parsearglist(CRuleNodePtr argrootp, int *next_tokp, const char* #if !defined(CR_DEBUG) && !defined(CR_CHKCONF) collapse(currarg); #endif - if (!BadPtr(currarg)) + if (currarg[0] != '\0') { DupString(argelemp, currarg); argrootp->arg[argrootp->numargs++] = (void *)argelemp; @@ -754,9 +754,9 @@ static int crule_parsearglist(CRuleNodePtr argrootp, int *next_tokp, const char* /* * This function is recursive.. I wish I knew a nonrecursive way but - * I dont. anyway, recursion is fun.. :) - * DO NOT CALL THIS FUNTION WITH A POINTER TO A NULL POINTER - * (ie: If *elem is NULL, you're doing it wrong - seg fault) + * I don't. Anyway, recursion is fun.. :) + * DO NOT CALL THIS FUNCTION WITH A POINTER TO A NULL POINTER + * (i.e.: If *elem is NULL, you're doing it wrong - seg fault) */ /** Free a connection rule and all its children. * @param[in,out] elem Pointer to pointer to element to free. MUST NOT BE NULL. @@ -767,7 +767,7 @@ void crule_free(struct CRuleNode** elem) if ((*(elem))->funcptr == crule__not) { - /* type conversions and ()'s are fun! ;) here have an asprin.. */ + /* type conversions and ()'s are fun! ;) here have an aspirin.. */ if ((*(elem))->arg[0] != NULL) crule_free((struct CRuleNode**) &((*(elem))->arg[0])); }