From baef5abd4dbb8ab62dee62d7a57d4ab26e8a1ca1 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Sun, 16 Aug 2020 10:13:31 +0200 Subject: [PATCH] Added missing implementation of gstring_replace. --- src/generic.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/generic.c b/src/generic.c index 1ff5b07..afc2d2e 100644 --- a/src/generic.c +++ b/src/generic.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2019 Andrea Zagli + * Copyright (C) 2015-2020 Andrea Zagli * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -98,6 +98,27 @@ gchar return g_strjoinv (replace, g_strsplit (string, origin, 0)); } +/** + * zak_utils_gstring_replace: + * @string: + * @origin: + * @replace: + * + */ +void +zak_utils_gstring_replace (GString *string, + const gchar *origin, + const gchar *replace) +{ + gchar *str; + + str = zak_utils_string_replace ((const gchar *)string->str, origin, replace); + + g_string_assign (string, str); + + g_free (str); +} + /** * zak_utils_gstring_replace_full: * @string: -- 2.49.0