diff options
author | Hans Hagen <pragma@wxs.nl> | 2009-11-09 17:47:00 +0100 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2009-11-09 17:47:00 +0100 |
commit | 66e5e30808380f832451181f72d3031592288e9a (patch) | |
tree | 87bbd912cbcfe5f8f9a4e797f34aa15760d6e271 /tex/context/base/typo-brk.lua | |
parent | 128e5756b60274b62fa31304324abd31c48d711a (diff) | |
download | context-66e5e30808380f832451181f72d3031592288e9a.tar.gz |
beta 2009.11.09 17:47
Diffstat (limited to 'tex/context/base/typo-brk.lua')
-rw-r--r-- | tex/context/base/typo-brk.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tex/context/base/typo-brk.lua b/tex/context/base/typo-brk.lua index 6a4d20bc1..e3d0a8ad8 100644 --- a/tex/context/base/typo-brk.lua +++ b/tex/context/base/typo-brk.lua @@ -115,6 +115,8 @@ breakpoints.methods[4] = function(head,start) -- - => - - - return head, start end +local methods = breakpoints.methods + function breakpoints.process(namespace,attribute,head) local done, numbers = false, languages.numbers local start, n = head, 0 @@ -129,7 +131,9 @@ function breakpoints.process(namespace,attribute,head) if map then local cmap = map[start.char] if cmap then - local smap = cmap[numbers[start.lang]] or cmap[""] + local lang = start.lang + -- we do a sanity check for language + local smap = lang and lang >= 0 and lang < 0x7FFF and (cmap[numbers[lang]] or cmap[""]) if smap then if n >= smap[2] then local m = smap[3] @@ -140,7 +144,7 @@ function breakpoints.process(namespace,attribute,head) if map[next.char] then break elseif m == 1 then - local method = breakpoints.methods[smap[1]] + local method = methods[smap[1]] if method then head, start = method(head,start) done = true |