diff options
author | Bruno Haible <bruno@clisp.org> | 2021-12-29 00:04:33 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2021-12-29 00:04:59 +0100 |
commit | 330c09389e2e6fe09ba2303082676854f8e6269a (patch) | |
tree | a134718cfaf3b52eb42c61157aadd22f2b912c2a /lib | |
parent | d45d16182d90c871b59582b4628b6e0e5f5a9ead (diff) | |
download | gnulib-330c09389e2e6fe09ba2303082676854f8e6269a.tar.gz |
unigbrk: Simplify code for regional indicators.
* lib/unigbrk/u-grapheme-breaks.h (FUNC): Make code for regional
indicators more future-proof.
* tests/unigbrk/test-u8-grapheme-breaks.c (main): Add test of regional
indicators.
* tests/unigbrk/test-u16-grapheme-breaks.c (main): Likewise.
* tests/unigbrk/test-u32-grapheme-breaks.c (main): Likewise.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/unigbrk/u-grapheme-breaks.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/unigbrk/u-grapheme-breaks.h b/lib/unigbrk/u-grapheme-breaks.h index 2b4ae0e60d..915d3d0e75 100644 --- a/lib/unigbrk/u-grapheme-breaks.h +++ b/lib/unigbrk/u-grapheme-breaks.h @@ -105,12 +105,8 @@ FUNC (const UNIT *s, size_t n, char *p) /* *p = 0 */; /* No break between RI if there is an odd number of RI characters before (GB12, GB13). */ - else if (prop == GBP_RI) - { - if (ri_count % 2 == 0) - *p = 1; - /* else *p = 0; */ - } + else if (prop == GBP_RI && (ri_count % 2) != 0) + /* *p = 0 */; /* Break everywhere (GB999). */ else *p = 1; |