projects
/
ossec-hids.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
obrisane nepotrebne datoteke od zadnjeg builda
[ossec-hids.git]
/
src
/
shared
/
regex_op.c
diff --git
a/src/shared/regex_op.c
b/src/shared/regex_op.c
old mode 100755
(executable)
new mode 100644
(file)
index
8bb0322
..
fe27381
--- a/
src/shared/regex_op.c
+++ b/
src/shared/regex_op.c
@@
-1,6
+1,3
@@
-/* @(#) $Id: ./src/shared/regex_op.c, 2011/09/08 dcid Exp $
- */
-
/* Copyright (C) 2009 Trend Micro Inc.
* All rights reserved.
*
/* Copyright (C) 2009 Trend Micro Inc.
* All rights reserved.
*
@@
-10,43
+7,37
@@
* Foundation
*/
* Foundation
*/
-
#ifndef WIN32
#ifndef WIN32
-#include "shared.h"
#include <regex.h>
#include <regex.h>
+#include "shared.h"
-/* OS_PRegex:
- * Compile a posix regex, returning NULL on error
- * Returns 1 if matches, 0 if not.
+/* Compile a POSIX regex, returning NULL on error
+ * Returns 1 if matches, 0 if not
*/
*/
-int OS_PRegex(char *str, char *regex)
+int OS_PRegex(const char *str, const char *regex)
{
regex_t preg;
{
regex_t preg;
- if(!str || !regex)
- return(0);
-
+ if (!str || !regex) {
+ return (0);
+ }
- if(regcomp(&preg, regex, REG_EXTENDED|REG_NOSUB) != 0)
- {
+ if (regcomp(&preg, regex, REG_EXTENDED | REG_NOSUB) != 0) {
merror("%s: Posix Regex compile error (%s).", __local_name, regex);
merror("%s: Posix Regex compile error (%s).", __local_name, regex);
- return(0);
+ return (0);
}
}
- if(regexec(&preg, str, strlen(str), NULL, 0) != 0)
- {
+ if (regexec(&preg, str, strlen(str), NULL, 0) != 0) {
/* Didn't match */
regfree(&preg);
/* Didn't match */
regfree(&preg);
- return(0);
+ return (0);
}
regfree(&preg);
}
regfree(&preg);
- return(1);
+ return (1);
}
}
-#endif
-
-/* EOF */
+#endif /* !WIN32 */