[Dev-luatex] Bug & FIX for pdf.reserveobj("annot")

Marcel F. Krüger zauguin at gmail.com
Tue Aug 11 18:45:25 CEST 2015


Hi,


according to the documentation you should be able to call
`pdf.reserveobj("annot")`, but doing so results in the error
"pdf.reserveobj() optional string must be "annot"". The problem is that a
null pointer and not the argument is compared to "annot".
According to the website, you are not ready for contributions yet, but I
still attached a patch.


--
Marcel Krüger

---
source/texk/web2c/luatexdir/lua/lpdflib.c | 1 +
1 file changed, 1 insertion(+)


diff --git a/source/texk/web2c/luatexdir/lua/lpdflib.c
b/source/texk/web2c/luatexdir/lua/lpdflib.c
index 7db3041..7158014 100644
--- a/source/texk/web2c/luatexdir/lua/lpdflib.c
+++ b/source/texk/web2c/luatexdir/lua/lpdflib.c
@@ -494,6 +494,7 @@ static int l_reserveobj(lua_State * L)
case 1:
if (!lua_isstring(L, -1))
luaL_error(L, "pdf.reserveobj() optional argument must be string");
+ st_s = luaL_checkstring(L, 1);
if (lua_key_eq(st_s, annot)) {
pdf_last_annot = pdf_create_obj(static_pdf, obj_type_annot, 0);
} else {

-- 
2.5.0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ntg.nl/pipermail/dev-luatex/attachments/20150811/d9242cad/attachment.html>


More information about the dev-luatex mailing list