X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=ossec-hids.git;a=blobdiff_plain;f=src%2Fos_regex%2Fos_regex_startswith.c;fp=src%2Fos_regex%2Fos_regex_startswith.c;h=322a8619ca7e0bc271d1ab5550c251ffbce2db9f;hp=0000000000000000000000000000000000000000;hb=789cbc8e52da68eba3517b920ef22e000cf3c9fd;hpb=ef70704f0b31b59bb719b884d6a99cb9e3e2044a diff --git a/src/os_regex/os_regex_startswith.c b/src/os_regex/os_regex_startswith.c new file mode 100644 index 0000000..322a861 --- /dev/null +++ b/src/os_regex/os_regex_startswith.c @@ -0,0 +1,21 @@ +/* Copyright (C) 2014 Trend Micro Inc. + * All right reserved. + * + * This program is a free software; you can redistribute it + * and/or modify it under the terms of the GNU General Public + * License (version 2) as published by the FSF - Free Software + * Foundation + */ + +#include "os_regex.h" +#include "os_regex_internal.h" + +int OS_StrStartsWith(const char *str, const char *pattern) { + while(*pattern) + { + if(*pattern++ != *str++) + return FALSE; + } + + return TRUE; +}