novi upstream verzije 2.8.3
[ossec-hids.git] / src / os_regex / os_regex_startswith.c
diff --git a/src/os_regex/os_regex_startswith.c b/src/os_regex/os_regex_startswith.c
new file mode 100644 (file)
index 0000000..322a861
--- /dev/null
@@ -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;
+}