Skip to content

Commit

Permalink
fix an infinite loop when upskip a left punctuation
Browse files Browse the repository at this point in the history
  • Loading branch information
chrox committed Jan 8, 2014
1 parent ab221ce commit c4c2436
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kpvcrlib/lvtextfm-punctuation.patch
Expand Up @@ -59,7 +59,7 @@ index 57bbf3b..e6f5913 100755
+ }
+
+ bool isCJKLeftPunctuation(lChar16 c) {
+ return c==L'“' || c==L'‘' /*|| c==L'「' || c==L'『' */|| c==L'《' || c==L'〈' || c==L'(' || c==L'【';
+ return c==L'“' || c==L'‘' || c==L'「' || c==L'『' || c==L'《' || c==L'〈' || c==L'(' || c==L'【';
+ }
+
/// Split paragraph into lines
Expand Down Expand Up @@ -99,7 +99,7 @@ index 57bbf3b..e6f5913 100755
+ int upSkipCount = 0;
+ if (endp > 1 && isCJKLeftPunctuation(*(m_text + endp))) {
+ CRLog::trace("skip skip punctuation %s, at index %d", LCSTR(lString16(m_text+endp, 1)), endp);
+ } else if (endp > 1 && isCJKLeftPunctuation(*(m_text + endp - 1))) {
+ } else if (endp > 1 && endp < m_length && isCJKLeftPunctuation(*(m_text + endp - 1))) {
+ endp--; wrapPos--;
+ CRLog::trace("up skip left punctuation %s, at index %d", LCSTR(lString16(m_text+endp, 1)), endp);
+ } else if (endp > 1 && isCJKPunctuation(*(m_text + endp))) {
Expand Down

0 comments on commit c4c2436

Please sign in to comment.