Skip to content
Snippets Groups Projects
Commit 0eeea2ab authored by Luigi Scarso's avatar Luigi Scarso
Browse files

small convenience fallback to id 0 in getattr (HH)

parent 57f64f52
Branches
Tags
No related merge requests found
......@@ -1937,7 +1937,8 @@ or, if no match is found, \type {nil}.
\stopfunctioncall
Tests if a node has an attribute with number \type {id} set. It returns the
value, or, if no match is found, \type {nil}.
value, or, if no match is found, \type {nil}. If no \type {id} is given then the
zero attributes is assumed.
\subsubsection{\type {node.find_attribute}}
......
No preview for this file type
......@@ -3010,7 +3010,10 @@ static int lua_nodelib_get_attribute(lua_State * L)
if (p != null) {
p = vlink(p);
if (p != null) {
int i = lua_tointeger(L, 2);
int i = 0;
if (lua_gettop(L) > 1) {
i = lua_tointeger(L, 2);
}
while (p != null) {
if (attribute_id(p) == i) {
int ret = attribute_value(p);
......@@ -3082,7 +3085,10 @@ static int lua_nodelib_direct_get_attribute(lua_State * L)
if (p != null) {
p = vlink(p);
if (p != null) {
int i = lua_tointeger(L, 2);
int i = 0;
if (lua_gettop(L) > 1) {
i = lua_tointeger(L, 2);
}
while (p != null) {
if (attribute_id(p) == i) {
int ret = attribute_value(p);
......
#define luatex_svn_revision 6771
#define luatex_svn_revision 6772
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment