From 626571a023a08ebd0a4b870b996a95b38ff95db6 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Thu, 15 Jan 2015 12:03:09 +0900 Subject: [PATCH] uniwbrk: ignore Extended/Format characters at BOL * lib/uniwbrk/u-wordbreaks.h (FUNC): Ignore Extend and Format characters if the previous character property is one of WBP_NEWLINE, WBP_CR, and WBP_LF. --- ChangeLog | 7 +++++++ lib/uniwbrk/u-wordbreaks.h | 9 +++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index adaae8ab3e..65696b8465 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2015-01-15 Daiki Ueno + + uniwbrk: ignore Extended/Format characters at BOL not BOS + * lib/uniwbrk/u-wordbreaks.h (FUNC): Ignore Extend and Format + characters if the previous character property is one of + WBP_NEWLINE, WBP_CR, and WBP_LF. + 2015-01-11 Jim Meyering test-strstr.c: avoid a trivial leak diff --git a/lib/uniwbrk/u-wordbreaks.h b/lib/uniwbrk/u-wordbreaks.h index 24d3dc136d..d35c72de54 100644 --- a/lib/uniwbrk/u-wordbreaks.h +++ b/lib/uniwbrk/u-wordbreaks.h @@ -112,8 +112,13 @@ FUNC (const UNIT *s, size_t n, char *p) } last_char_prop = prop; - /* Ignore Format and Extend characters, except at the start of the string. */ - if (last_compchar_prop < 0 || !(prop == WBP_EXTEND || prop == WBP_FORMAT)) + /* Ignore Format and Extend characters, except at the start + of the line. */ + if (last_compchar_prop < 0 + || last_compchar_prop == WBP_CR + || last_compchar_prop == WBP_LF + || last_compchar_prop == WBP_NEWLINE + || !(prop == WBP_EXTEND || prop == WBP_FORMAT)) { secondlast_compchar_prop = last_compchar_prop; last_compchar_prop = prop; -- 2.39.5