Fix bidi purge loop logic a bit - libgrapheme - unicode string library
(HTM) git clone git://git.suckless.org/libgrapheme
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 53f5421ae389b0312bdcab1c715a03f175a58b07
(DIR) parent bbbc72cba69445535dd035dfe1ee10d473655629
(HTM) Author: Laslo Hunhold <dev@frign.de>
Date: Tue, 29 Nov 2022 23:45:10 +0100
Fix bidi purge loop logic a bit
Otherwise you could skip one element by accident. This does not have
direct consequences, but may lead to slightly wrong behaviour when
there are stray opening brackets.
Signed-off-by: Laslo Hunhold <dev@frign.de>
Diffstat:
M src/bidirectional.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
(DIR) diff --git a/src/bidirectional.c b/src/bidirectional.c
@@ -636,8 +636,9 @@ preprocess_bracket_pairs(uint_least32_t *buf, size_t buflen, size_t off,
/* remove all uncompleted FIFO elements
* above i - 1 */
- for (j = i; j < fifo_len; j++) {
+ for (j = i; j < fifo_len;) {
if (fifo[j].complete) {
+ j++;
continue;
}