talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 3edfeed71c533714dd28f9af6d0198da879ebc19
parent e67ebcf6e95406d72b604fd5b764d58a76a1a708
Author: wwp <subscript@free.fr>
Date:   Thu, 25 Jan 2024 10:56:27 +0100

fix bug 4750, 'remove regcomp wrapper and call regcomp directly'

Diffstat:
Msrc/common/string_match.c | 13-------------
Msrc/common/string_match.h | 6------
Msrc/prefs_folder_item.c | 3+--
Msrc/summaryview.c | 3+--
4 files changed, 2 insertions(+), 23 deletions(-)

diff --git a/src/common/string_match.c b/src/common/string_match.c @@ -35,19 +35,6 @@ #include "string_match.h" #include "utils.h" -int string_match_precompile (gchar *rexp, regex_t *preg, int cflags) -{ - int problem = 0; - - cm_return_val_if_fail(rexp, -1); - cm_return_val_if_fail(*rexp, -1); - - problem = regcomp(preg, rexp, cflags); - - return problem; -} - - gchar *string_remove_match(gchar *buf, gint buflen, gchar * txt, regex_t *preg) { regmatch_t match; diff --git a/src/common/string_match.h b/src/common/string_match.h @@ -26,12 +26,6 @@ #include <regex.h> #include <glib.h> -/* Precompile the preg buffer for the rexp regexp string. See regex man for the - * meaning of cflags. - */ - -int string_match_precompile (gchar *rexp, regex_t *preg, int cflags); - /* remove from txt the substrings matching the regexp in the precompiled preg buffer. * The result is stored in the preallocated buf buffer which maximal length * is buflen. diff --git a/src/prefs_folder_item.c b/src/prefs_folder_item.c @@ -1849,8 +1849,7 @@ static regex_t *summary_compile_simplify_regexp(gchar *simplify_subject_regexp) preg = g_new0(regex_t, 1); - err = string_match_precompile(simplify_subject_regexp, - preg, REG_EXTENDED); + err = regcomp(preg, simplify_subject_regexp, REG_EXTENDED); if (err) { regerror(err, preg, buf, BUFFSIZE); g_free(preg); diff --git a/src/summaryview.c b/src/summaryview.c @@ -8301,8 +8301,7 @@ static regex_t *summary_compile_simplify_regexp(gchar *simplify_subject_regexp) preg = g_new0(regex_t, 1); - err = string_match_precompile(simplify_subject_regexp, - preg, REG_EXTENDED); + err = regcomp(preg, simplify_subject_regexp, REG_EXTENDED); if (err) { regerror(err, preg, buf, BUFFSIZE); alertpanel_error(_("Regular expression (regexp) error:\n%s"), buf);