summaryrefslogtreecommitdiff
path: root/scripts/context
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2010-10-21 15:20:13 +0300
committerMarius <mariausol@gmail.com>2010-10-21 15:20:13 +0300
commit7621c6a4885e503f5153f7419278f6f6486a335a (patch)
tree9dbb108943fac6abb17bfac7ef5cec9bf8f5051a /scripts/context
parent575435e91f9abcf123aa96fd3790e0d61b719333 (diff)
downloadcontext-7621c6a4885e503f5153f7419278f6f6486a335a.tar.gz
beta 2010.10.21 14:02
Diffstat (limited to 'scripts/context')
-rw-r--r--scripts/context/lua/mtxrun.lua20
-rw-r--r--scripts/context/stubs/mswin/mtxrun.lua20
-rw-r--r--scripts/context/stubs/unix/mtxrun20
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 100644
--- 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