[glib/glib-2-68: 7/8] g_string_replace: Document behaviour of zero-length match pattern




commit 4ce606878e8aaddfd33679b50ce63ce6e920718e
Author: Simon McVittie <smcv collabora com>
Date:   Mon Aug 2 12:36:26 2021 +0100

    g_string_replace: Document behaviour of zero-length match pattern
    
    Signed-off-by: Simon McVittie <smcv collabora com>

 glib/gstring.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/glib/gstring.c b/glib/gstring.c
index 94d700b7a..4f1d116d3 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 the number of
  * instances 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]