@pmatilai commented on this pull request.


> -     rpmver v1 = rpmverParse(lua_tostring(L, -1));
+    if (lua_isstring(L, -1))
+       rpmversion = lua_tostring(L, -1);
+    if (rpmversion) {
+       rpmver v1 = rpmverParse(rpmversion);
+       rpmver v2 = rpmverParse(removed_in);
+       if (v2 && rpmverCmp(v1, v2) < 0)
+           err = 0;
+       rpmverFree(v2);
+       rpmverFree(v1);
+    }
+    lua_pop(L, 1);
+
+    if (err) {
+       luaL_error(L, "%s() is no longer available, use rpm.spawn() or 
rpm.execute() instead", func);
+    }

Added a return with "not reached" comment there - this is commonly used as 
"return luaL_error();" but that wont work here because our function returns 
void. And that left me puzzling how does a macro know how to return? It doesn't 
- luaL_error() is not a macro contrary to what I said above, it exists via 
longjmp(). So a rather exotic bird.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3678#discussion_r2012333667
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/3678/review/2714154...@github.com>
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
https://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to