talons

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

commit cfb7606882f867569b983ce66b64b1362fb87d6e
parent a8d84bd455fd5d2a2bc26975fc834abeb2c20787
Author: Andrej Kacian <ticho@claws-mail.org>
Date:   Sat, 15 Dec 2018 18:32:05 +0100

Remove strstr2() in favour of g_strstr_len()

Diffstat:
Msrc/action.c | 2+-
Msrc/common/utils.c | 8--------
Msrc/common/utils.h | 2--
3 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/src/action.c b/src/action.c @@ -704,7 +704,7 @@ static gboolean execute_filtering_actions(gchar *action, GSList *msglist) mainwin = mainwindow_get_mainwindow(); } - if (NULL == (sbegin = strstr2(action, "%as{"))) + if (NULL == (sbegin = g_strstr_len(action, -1, "%as{"))) return FALSE; sbegin += sizeof "%as{" - 1; if (NULL == (send = strrchr(sbegin, '}'))) diff --git a/src/common/utils.c b/src/common/utils.c @@ -218,14 +218,6 @@ gchar *to_human_readable(goffset size) } } -/* strstr with NULL-checking */ -gchar *strstr2(const gchar *s1, const gchar *s2) -{ - if (s1 == NULL || s2 == NULL) - return NULL; - else - return strstr(s1, s2); -} /* compare paths */ gint path_cmp(const gchar *s1, const gchar *s2) { diff --git a/src/common/utils.h b/src/common/utils.h @@ -271,8 +271,6 @@ gchar *itos (gint n); gchar *to_human_readable (goffset size); /* alternative string functions */ -gchar *strstr2 (const gchar *s1, - const gchar *s2); gint path_cmp (const gchar *s1, const gchar *s2); gchar *strretchomp (gchar *str);