projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Integrate core C implementation
[project/luci.git]
/
libs
/
core
/
src
/
luci_cutil.c
diff --git
a/libs/core/src/luci_cutil.c
b/libs/core/src/luci_cutil.c
index
001273b
..
9f56c43
100644
(file)
--- a/
libs/core/src/luci_cutil.c
+++ b/
libs/core/src/luci_cutil.c
@@
-91,11
+91,13
@@
static int luci__instantiate(lua_State *L) {
/* luci.cutil.class(baseclass) */
static int luci_class(lua_State *L) {
/* luci.cutil.class(baseclass) */
static int luci_class(lua_State *L) {
+ int n = lua_gettop(L);
+
/* Create class */
lua_newtable(L);
/* Create metatable and register parent class if any */
/* Create class */
lua_newtable(L);
/* Create metatable and register parent class if any */
- if (lua_istable(L, 1)) {
+ if (
n &&
lua_istable(L, 1)) {
lua_createtable(L, 0, 2);
lua_pushvalue(L, 1);
lua_setfield(L, -2, "__index");
lua_createtable(L, 0, 2);
lua_pushvalue(L, 1);
lua_setfield(L, -2, "__index");