X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;ds=sidebyside;f=src%2Fos_regex%2Fos_match.c;fp=src%2Fos_regex%2Fos_match.c;h=a7a7ccf5931493c9f235a605d5e032c7e033bb44;hb=789cbc8e52da68eba3517b920ef22e000cf3c9fd;hp=3687523e969d1b4d2967c8365ff40357ddc253e5;hpb=ef70704f0b31b59bb719b884d6a99cb9e3e2044a;p=ossec-hids.git diff --git a/src/os_regex/os_match.c b/src/os_regex/os_match.c index 3687523..a7a7ccf 100755 --- a/src/os_regex/os_match.c +++ b/src/os_regex/os_match.c @@ -24,7 +24,7 @@ * only going to be used once. * Returns 1 on success or 0 on failure. */ -int OS_Match2(char *pattern, char *str) +int OS_Match2(const char *pattern, const char *str) { int r_code = 0; OSMatch reg; @@ -43,46 +43,4 @@ int OS_Match2(char *pattern, char *str) return(r_code); } - -#ifdef NOTHINGEMPTY -/** int OS_Match3(char *pattern, char *str) v2.6 - * - * This function is used - * to match any values from a delimited string - * e.g. match pattern "abc" from string "123,abc,xyz" - */ -int OS_Match3(char *pattern, char *str, char *delimiter) -{ - int r_code = 0; - char *token = NULL; - char *dupstr = NULL; - char *saveptr = NULL; - - /* debug2("1. str [%s], dupstr [%s], token[%s], delim [%s]", str, dupstr, token, delimiter); */ - - os_strdup(str, dupstr); - /* debug2("2. str [%s], dupstr [%s], token[%s], delim [%s]", str, dupstr, token, delimiter); */ - - token = strtok_r(dupstr, delimiter, &saveptr); - /* debug2("3. str [%s], dupstr [%s], token[%s], delim [%s]", str, dupstr, token, delimiter); */ - - while (token != NULL) - { - debug2("Matching [%s] with [%s]", pattern, token); - if (!strcmp(pattern, token)) - { - r_code = 1; - break; - } - - token = strtok_r(NULL, delimiter, &saveptr); - } - - /* debug2("4. str [%s], dupstr [%s], token[%s], delim [%s]", str, dupstr, token, delimiter); */ - free(dupstr); - return(r_code); -} -#endif - - /* EOF */