diff options
author | Hans Hagen <pragma@wxs.nl> | 2010-10-21 14:02:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2010-10-21 14:02:00 +0200 |
commit | d28ab89ebb3382dccaf69fcc582f2fe4a1571dc0 (patch) | |
tree | f7141de9d6fc6511ecca0957a4c113bcf42e3b6e /scripts | |
parent | 06c355066a4cf2af674302948c2f3caee06932f2 (diff) | |
download | context-d28ab89ebb3382dccaf69fcc582f2fe4a1571dc0.tar.gz |
beta 2010.10.21 14:02
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/context/lua/mtxrun.lua | 20 | ||||
-rw-r--r-- | scripts/context/stubs/mswin/mtxrun.lua | 20 | ||||
-rwxr-xr-x | scripts/context/stubs/unix/mtxrun | 20 |
3 files changed, 39 insertions, 21 deletions
diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index 00d4fe9c3..c678597e1 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -645,15 +645,21 @@ end table.sortedkeys = sortedkeys table.sortedhashkeys = sortedhashkeys +local function nothing() end + local function sortedhash(t) - local s = sortedhashkeys(t) -- maybe just sortedkeys - local n = 0 - local function kv(s) - n = n + 1 - local k = s[n] - return k, t[k] + if t then + local s = sortedhashkeys(t) -- maybe just sortedkeys + local n = 0 + local function kv(s) + n = n + 1 + local k = s[n] + return k, t[k] + end + return kv, s + else + return nothing end - return kv, s end table.sortedhash = sortedhash diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index 00d4fe9c3..c678597e1 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -645,15 +645,21 @@ end table.sortedkeys = sortedkeys table.sortedhashkeys = sortedhashkeys +local function nothing() end + local function sortedhash(t) - local s = sortedhashkeys(t) -- maybe just sortedkeys - local n = 0 - local function kv(s) - n = n + 1 - local k = s[n] - return k, t[k] + if t then + local s = sortedhashkeys(t) -- maybe just sortedkeys + local n = 0 + local function kv(s) + n = n + 1 + local k = s[n] + return k, t[k] + end + return kv, s + else + return nothing end - return kv, s end table.sortedhash = sortedhash diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index 00d4fe9c3..c678597e1 100755 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -645,15 +645,21 @@ end table.sortedkeys = sortedkeys table.sortedhashkeys = sortedhashkeys +local function nothing() end + local function sortedhash(t) - local s = sortedhashkeys(t) -- maybe just sortedkeys - local n = 0 - local function kv(s) - n = n + 1 - local k = s[n] - return k, t[k] + if t then + local s = sortedhashkeys(t) -- maybe just sortedkeys + local n = 0 + local function kv(s) + n = n + 1 + local k = s[n] + return k, t[k] + end + return kv, s + else + return nothing end - return kv, s end table.sortedhash = sortedhash |