From b13777841ffe6e0a3217b7620b8dcb8634fb7ed3 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 2 Aug 2021 12:36:26 +0100 Subject: [PATCH] g_string_replace: Document behaviour of zero-length match pattern Signed-off-by: Simon McVittie --- glib/gstring.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/glib/gstring.c b/glib/gstring.c index e3ec98b0b..da9c5f7ab 100644 --- a/glib/gstring.c +++ b/glib/gstring.c @@ -966,6 +966,11 @@ g_string_erase (GString *string, * less than @limit, all instances are replaced. If @limit is `0`, * all instances of @find are replaced. * + * If @find is the empty string, since versions 2.69.1 and 2.68.4 the + * replacement will be inserted no more than once per possible position + * (beginning of string, end of string and between characters). This did + * not work correctly in earlier versions. + * * Returns: the number of find and replace operations performed. * * Since: 2.68