commit 319dee62ddeead3c7c05e46f95f8b2dd50de0c2c
parent dd3e5698bdea27a9366a5eb636636f4112900393
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:
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);