summaryrefslogtreecommitdiff
path: root/lib/unigbrk/u-grapheme-breaks.h
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2025-10-18 19:07:35 +0200
committerJörg Frings-Fürst <debian@jff.email>2025-10-18 19:07:35 +0200
commitfa23d938c040bc8af305a31fa874df55b2a02576 (patch)
tree9704e2f7bd8962ea8911cd6f4e2d37227d7eff2e /lib/unigbrk/u-grapheme-breaks.h
parentdf9dbf9b0915e432a4a2c4182f60af36374eaaab (diff)
parent693ae7b71dfdd1a8146266b5794a71c0dbe5dff0 (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'lib/unigbrk/u-grapheme-breaks.h')
-rw-r--r--lib/unigbrk/u-grapheme-breaks.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/unigbrk/u-grapheme-breaks.h b/lib/unigbrk/u-grapheme-breaks.h
index 3e8f4953..30d5853a 100644
--- a/lib/unigbrk/u-grapheme-breaks.h
+++ b/lib/unigbrk/u-grapheme-breaks.h
@@ -1,6 +1,5 @@
/* Grapheme cluster break function.
- Copyright (C) 2010-2024 Free Software Foundation, Inc.
- Written by Ben Pfaff <blp@cs.stanford.edu>, 2010.
+ Copyright (C) 2010-2025 Free Software Foundation, Inc.
This file is free software.
It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+".
@@ -23,6 +22,8 @@
License and of the GNU General Public License along with this
program. If not, see <https://www.gnu.org/licenses/>. */
+/* Written by Ben Pfaff, Daiki Ueno, Bruno Haible. */
+
/* This file implements section 3 "Grapheme Cluster Boundaries"
of Unicode Standard Annex #29 <https://www.unicode.org/reports/tr29/>. */
@@ -61,8 +62,9 @@ FUNC (const UNIT *s, size_t n, char *p)
/* Don't break inside multibyte characters. */
memset (p, 0, n);
- while (s < s_end)
+ do
{
+ /* Invariant: Here s < s_end. */
ucs4_t uc;
int count = U_MBTOUC (&uc, s, s_end - s);
int prop = uc_graphemeclusterbreak_property (uc);
@@ -157,5 +159,6 @@ FUNC (const UNIT *s, size_t n, char *p)
s += count;
p += count;
}
+ while (s < s_end);
}
}