aboutsummaryrefslogtreecommitdiff
path: root/src/filter.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-08-05 10:27:34 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-08-05 10:27:34 +0000
commit12cb734c3c7ccdec2a7c9f7fc7517aa37d4fd385 (patch)
tree2d2a720903eb1ba2e3e4e507f467617a26469ee3 /src/filter.c
parente2a9edf210f40519169a1169801df56fcb4ef0fc (diff)
check for regex.h and regcomp().
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@471 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/filter.c')
-rw-r--r--src/filter.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/filter.c b/src/filter.c
index 67914138..26c77c91 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -1,6 +1,6 @@
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2004 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2005 Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -29,7 +29,9 @@
#include <strings.h>
#include <stdlib.h>
#include <sys/types.h>
-#include <regex.h>
+#if HAVE_REGEX_H
+# include <regex.h>
+#endif
#include <time.h>
#include "procheader.h"
@@ -271,6 +273,7 @@ gint filter_action_exec(FilterRule *rule, MsgInfo *msginfo, const gchar *file,
static gboolean strmatch_regex(const gchar *haystack, const gchar *needle)
{
+#if HAVE_REGEX_H && HAVE_REGCOMP
gint ret = 0;
regex_t preg;
regmatch_t pmatch[1];
@@ -286,6 +289,7 @@ static gboolean strmatch_regex(const gchar *haystack, const gchar *needle)
if (pmatch[0].rm_so != -1)
return TRUE;
else
+#endif
return FALSE;
}