[glib/wip/smcv/2452-g-string-0-length-replace: 5/5] g_string_replace: Document behaviour of zero-length match pattern
- From: Simon McVittie <smcv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/smcv/2452-g-string-0-length-replace: 5/5] g_string_replace: Document behaviour of zero-length match pattern
- Date: Mon, 2 Aug 2021 11:36:50 +0000 (UTC)
commit b13777841ffe6e0a3217b7620b8dcb8634fb7ed3
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 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]