Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
bb9bedaa
...
bb9bedaafec54b256ad721176cc38c3adb859593
authored
2001-08-12 02:00:58 +0000
by
Alain Magloire
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
* mail/msgset.y: Remove HAVE_REGEX macro and check variable
"noregex" before using regex.
1 parent
99d558a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
22 deletions
mail/msgset.y
mail/msgset.y
View file @
bb9beda
...
...
@@ -18,9 +18,7 @@
%{
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_REGEXEC
#include <regex.h>
#endif
#include <xalloc.h>
#include <mail.h>
...
...
@@ -444,26 +442,29 @@ select_subject (message_t msg, void *closure)
message_get_header (msg, &hdr);
if (header_aget_value (hdr, MU_HEADER_SUBJECT, &subject) == 0)
{
#ifdef HAVE_REGEXEC
/* Match string against the extended regular expression(ignoring
case) in pattern, treating errors as no match.
Return 1 for match, 0 for no match.
*/
regex_t re;
int status;
if (regcomp (&re, expr, REG_EXTENDED | REG_ICASE) != 0)
return 0;
status = regexec (&re, subject, 0, NULL, 0);
if (status != 0)
return 0;
return status == 0;
#else
int rc;
util_strupper (subject);
rc = strstr (subject, expr) != NULL;
free (subject);
return rc;
#endif
if (!(util_find_env ("noregex"))->set)
{
/* Match string against the extended regular expression(ignoring
case) in pattern, treating errors as no match.
Return 1 for match, 0 for no match.
*/
regex_t re;
int status;
if (regcomp (&re, expr, REG_EXTENDED | REG_ICASE) != 0)
return 0;
status = regexec (&re, subject, 0, NULL, 0);
if (status != 0)
return 0;
return status == 0;
}
else
{
int rc;
util_strupper (subject);
rc = strstr (subject, expr) != NULL;
free (subject);
return rc;
}
}
return 0;
}
...
...
Please
register
or
sign in
to post a comment