summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/lua/luanode.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/lua/luanode.c')
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/luanode.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/Build/source/texk/web2c/luatexdir/lua/luanode.c b/Build/source/texk/web2c/luatexdir/lua/luanode.c
index a0c97e37dc8..502c407079e 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luanode.c
+++ b/Build/source/texk/web2c/luatexdir/lua/luanode.c
@@ -180,16 +180,17 @@ int lua_appendtovlist_callback(halfword box, int location, halfword prev_depth,
luatex_error(Luas, (i == LUA_ERRRUN ? 0 : 1));
return 0;
}
- if (lua_type(Luas,-1) == LUA_TNUMBER) {
- *next_depth = lua_roundnumber(Luas,-1);
- *prev_set = true;
- if (lua_type(Luas, -2) != LUA_TNIL) {
- p = check_isnode(Luas, -2);
- *result = *p;
- }
- } else if (lua_type(Luas, -1) != LUA_TNIL) {
- p = check_isnode(Luas, -1);
+ if (lua_type(Luas, -2) == LUA_TUSERDATA) {
+ p = check_isnode(Luas, -2);
*result = *p;
+ } else if (lua_type(Luas, -2) == LUA_TNIL) {
+ *result = null;
+ } else {
+ normal_warning("append to vlist","error: node or nil expected");
+ }
+ if (lua_type(Luas, -1) == LUA_TNUMBER) {
+ *next_depth = lua_roundnumber(Luas, -1);
+ *prev_set = 1;
}
return 1;
}