]> Savannah Git Hosting - gnulib.git/commitdiff
uniwbrk: ignore Extended/Format characters at BOL
authorDaiki Ueno <ueno@gnu.org>
Thu, 15 Jan 2015 03:03:09 +0000 (12:03 +0900)
committerDaiki Ueno <ueno@gnu.org>
Thu, 15 Jan 2015 03:03:09 +0000 (12:03 +0900)
* 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
lib/uniwbrk/u-wordbreaks.h

index adaae8ab3ee688df3fed4898d8d3ac2cf3220cfb..65696b8465c8771de2e95130ebd25867ed18161e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-01-15  Daiki Ueno  <ueno@gnu.org>
+
+       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  <meyering@fb.com>
 
        test-strstr.c: avoid a trivial leak
index 24d3dc136d2e85591a76298c8db743c7e103225d..d35c72de54cdb759d645740225266dcb9939d2e9 100644 (file)
@@ -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;