Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int lua_getfenv(lua_State *L) { // function or index as 1
- //printType(lua_type(L, 1));
- int idx = 0;
- const char* nm;
- while (true) {
- idx++;
- nm = lua_getupvalue(L, 1, idx);
- //printf(nm ? nm : "NULL");
- if (strcmp(nm ? nm : "", "_ENV")) {
- //printf("returning ");
- return 1;
- }
- if (nm==NULL) {
- //printf("goofed ");
- return 1;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement