projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rocco Rutte:
[apps/madmutt.git]
/
lib
/
rx.c
diff --git
a/lib/rx.c
b/lib/rx.c
index
1330af8
..
168a3fe
100644
(file)
--- a/
lib/rx.c
+++ b/
lib/rx.c
@@
-4,16
+4,20
@@
* please see the file GPL in the top level source directory.
*/
* please see the file GPL in the top level source directory.
*/
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "rx.h"
#include "mem.h"
#include "str.h"
rx_t *rx_compile (const char *s, int flags) {
#include "rx.h"
#include "mem.h"
#include "str.h"
rx_t *rx_compile (const char *s, int flags) {
- rx_t *pp = safe_calloc (
sizeof (rx_t), 1
);
+ rx_t *pp = safe_calloc (
1, sizeof (rx_t)
);
pp->pattern = safe_strdup (s);
pp->pattern = safe_strdup (s);
- pp->rx = safe_calloc (
sizeof (regex_t), 1
);
+ pp->rx = safe_calloc (
1, sizeof (regex_t)
);
if (REGCOMP(pp->rx, NONULL (s), flags) != 0)
rx_free (&pp);
if (REGCOMP(pp->rx, NONULL (s), flags) != 0)
rx_free (&pp);
@@
-33,7
+37,7
@@
int rx_compare (const rx_t* r1, const rx_t* r2) {
int rx_list_match (list2_t* l, const char* pat) {
int i = 0;
int rx_list_match (list2_t* l, const char* pat) {
int i = 0;
- if (!pat || list_empty(l))
+ if (!pat ||
!*pat ||
list_empty(l))
return (0);
for (i = 0; i < l->length; i++)
if (REGEXEC(((rx_t*) l->data[i])->rx, pat) == 0)
return (0);
for (i = 0; i < l->length; i++)
if (REGEXEC(((rx_t*) l->data[i])->rx, pat) == 0)