[tex-live] [PATCH] Fix tautological (always false) compare

Stefan Brüns stefan.bruens at rwth-aachen.de
Mon Dec 24 00:31:01 CET 2018


The current code compares the PDF document change counter with itself, which
is always false. Compare change counter of the wrapped document with the
counter of the wrapper instead.

---
 luatexdir/lua/lepdflib.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/texk/web2c/luatexdir/lua/lepdflib.cc b/texk/web2c/luatexdir/lua/
lepdflib.cc
index 795550e..63fcc11 100644
--- a/texk/web2c/luatexdir/lua/lepdflib.cc
+++ b/texk/web2c/luatexdir/lua/lepdflib.cc
@@ -1966,7 +1966,7 @@ static int m_Object_arrayAdd(lua_State * L)
     if (uin->pd != NULL && uobj->pd != NULL && uin->pd != uobj->pd)
         pdfdoc_differs_error(L);
     if ((uin->pd != NULL && uin->pd->pc != uin->pc)
-        || (uobj->pd != NULL && uobj->pd->pc != uobj->pd->pc))
+        || (uobj->pd != NULL && uobj->pd->pc != uobj->pc))
         pdfdoc_changed_error(L);
     if (!((Object *) uin->d)->isArray())
         luaL_error(L, "Object is not an Array");
@@ -2047,7 +2047,7 @@ static int m_Object_dictAdd(lua_State * L)
     if (uin->pd != NULL && uobj->pd != NULL && uin->pd != uobj->pd)
         pdfdoc_differs_error(L);
     if ((uin->pd != NULL && uin->pd->pc != uin->pc)
-        || (uobj->pd != NULL && uobj->pd->pc != uobj->pd->pc))
+        || (uobj->pd != NULL && uobj->pd->pc != uobj->pc))
         pdfdoc_changed_error(L);
     if (!((Object *) uin->d)->isDict())
         luaL_error(L, "Object is not a Dict");
@@ -2065,7 +2065,7 @@ static int m_Object_dictSet(lua_State * L)
     if (uin->pd != NULL && uobj->pd != NULL && uin->pd != uobj->pd)
         pdfdoc_differs_error(L);
     if ((uin->pd != NULL && uin->pd->pc != uin->pc)
-        || (uobj->pd != NULL && uobj->pd->pc != uobj->pd->pc))
+        || (uobj->pd != NULL && uobj->pd->pc != uobj->pc))
         pdfdoc_changed_error(L);
     if (!((Object *) uin->d)->isDict())
         luaL_error(L, "Object is not a Dict");
-- 
2.19.2


-- 
Stefan Brüns  /  Bergstraße 21  /  52062 Aachen
home: +49 241 53809034     mobile: +49 151 50412019
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part.
URL: <https://tug.org/pipermail/tex-live/attachments/20181224/6d3630ba/attachment.sig>


More information about the tex-live mailing list