projects
/
platform
/
upstream
/
rpm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
67d6e75
)
Be more careful about errors in lua rpm vercmp()
author
Panu Matilainen
<pmatilai@redhat.com>
Tue, 10 Feb 2009 12:11:28 +0000
(14:11 +0200)
committer
Panu Matilainen
<pmatilai@redhat.com>
Wed, 11 Feb 2009 10:32:24 +0000
(12:32 +0200)
lib/rpmliblua.c
patch
|
blob
|
history
diff --git
a/lib/rpmliblua.c
b/lib/rpmliblua.c
index
6876d2f
..
046ed31
100644
(file)
--- a/
lib/rpmliblua.c
+++ b/
lib/rpmliblua.c
@@
-12,14
+12,15
@@
static int rpm_vercmp(lua_State *L)
{
const char *v1, *v2;
- int rc;
+ int rc
= 0
;
v1 = luaL_checkstring(L, 1);
v2 = luaL_checkstring(L, 2);
-
- rc = rpmvercmp(v1, v2);
- lua_pushinteger(L, rc);
- return 1;
+ if (v1 && v2) {
+ lua_pushinteger(L, rpmvercmp(v1, v2));
+ rc = 1;
+ }
+ return rc;
}
static const luaL_reg luarpmlib_f[] = {