diff options
| author | Alexander Pickering <alex@cogarr.net> | 2020-09-15 03:40:00 -0400 |
|---|---|---|
| committer | Alexander Pickering <alex@cogarr.net> | 2020-09-15 03:40:00 -0400 |
| commit | 105ea66aba31825512fea8f281b67f9c2a1d79a5 (patch) | |
| tree | 2bd4d2bd4fa552d770d960420a3c35bf5c91e283 /src/lua-nng-common.c | |
| parent | 94f798fe243313f78f055a48267313e87afe2a67 (diff) | |
| download | lua-nng-105ea66aba31825512fea8f281b67f9c2a1d79a5.tar.gz lua-nng-105ea66aba31825512fea8f281b67f9c2a1d79a5.tar.bz2 lua-nng-105ea66aba31825512fea8f281b67f9c2a1d79a5.zip | |
dos2unix
Diffstat (limited to 'src/lua-nng-common.c')
| -rw-r--r-- | src/lua-nng-common.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/lua-nng-common.c b/src/lua-nng-common.c index a12ed79..a7485e5 100644 --- a/src/lua-nng-common.c +++ b/src/lua-nng-common.c @@ -1,22 +1,22 @@ -#include "lua-nng-common.h"
-/*Just copy+paste lua's runtime traceback funtion*/
-int traceback (lua_State *L) {
- if (!lua_isstring(L, 1)) /* 'message' not a string? */
- return 1; /* keep it intact */
- lua_getglobal(L,"debug");
- if (!lua_istable(L, -1)) {
- lua_pop(L, 1);
- return 1;
- }
- lua_getfield(L, -1, "traceback");
- if (!lua_isfunction(L, -1)) {
- lua_pop(L, 2);
- return 1;
- }
- lua_pushvalue(L, 1); /* pass error message */
- lua_pushinteger(L, 2); /* skip this function and traceback */
- lua_call(L, 2, 1); /* call debug.traceback */
- printf("%s\n",lua_tostring(L,-1));
- return 1;
-}
-
+#include "lua-nng-common.h" +/*Just copy+paste lua's runtime traceback funtion*/ +int traceback (lua_State *L) { + if (!lua_isstring(L, 1)) /* 'message' not a string? */ + return 1; /* keep it intact */ + lua_getglobal(L,"debug"); + if (!lua_istable(L, -1)) { + lua_pop(L, 1); + return 1; + } + lua_getfield(L, -1, "traceback"); + if (!lua_isfunction(L, -1)) { + lua_pop(L, 2); + return 1; + } + lua_pushvalue(L, 1); /* pass error message */ + lua_pushinteger(L, 2); /* skip this function and traceback */ + lua_call(L, 2, 1); /* call debug.traceback */ + printf("%s\n",lua_tostring(L,-1)); + return 1; +} + |
