diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-09-10 09:52:59 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-09-10 09:52:59 +0000 |
commit | 7e17932009a54c6047241ce05f043b51cce32233 (patch) | |
tree | 7b6001c89a8bbf5dee032af1048892cf9ab20373 /Build/source/texk/web2c/luatexdir/lang | |
parent | 8072d653e5694112aadd35396317648fa019dc6e (diff) |
luatexdir: sync with the upstream
git-svn-id: svn://tug.org/texlive/trunk@42031 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/lang')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/lang/texlang.w | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/Build/source/texk/web2c/luatexdir/lang/texlang.w b/Build/source/texk/web2c/luatexdir/lang/texlang.w index f6dcfdb9153..cf88928e8d4 100644 --- a/Build/source/texk/web2c/luatexdir/lang/texlang.w +++ b/Build/source/texk/web2c/luatexdir/lang/texlang.w @@ -906,11 +906,17 @@ void hnj_hyphenation(halfword head, halfword tail) } if (wordlen <= lhmin) { lhmin = lhmin - lchar + 1 ; + if (lhmin < 0) + lhmin = 1; } if (wordlen >= rhmin) { rhmin = rhmin - lchar + 1 ; + if (rhmin < 0) + rhmin = 1; } hmin = hmin - lchar + 1 ; + if (hmin < 0) + rhmin = 1; lchar = character(r) ; } hy = uni2string(hy, (unsigned) lchar); @@ -962,20 +968,35 @@ void hnj_hyphenation(halfword head, halfword tail) left = wordstart; for (i = lhmin; i > 1; i--) { left = vlink(left); - while (!is_simple_character(left)) + while (!is_simple_character(left)) { left = vlink(left); + } + /* + if (!left) + break ; + */ + /* what is left overruns right .. a bit messy */ } right = r; for (i = rhmin; i > 0; i--) { right = alink(right); - while (!is_simple_character(right)) + while (!is_simple_character(right)) { right = alink(right); + } + /* + if (!right) + break ; + */ + /* what is right overruns left .. a bit messy */ } + /* maybe an extra check ... */ + /* if (left && right) { */ #ifdef VERBOSE - formatted_warning("hyphenation","hyphenate %s (c=%d,l=%d,r=%d) from %c to %c", - utf8word, clang, lhmin, rhmin, character(left), character(right)); + formatted_warning("hyphenation","hyphenate %s (c=%d,l=%d,r=%d) from %c to %c", + utf8word, clang, lhmin, rhmin, character(left), character(right)); #endif - (void) hnj_hyphen_hyphenate(lang->patterns, wordstart, end_word, wordlen, left, right, &langdata); + (void) hnj_hyphen_hyphenate(lang->patterns, wordstart, end_word, wordlen, left, right, &langdata); + /* } */ } } explicit_hyphen = false; |