Implement shell builtins: cd, exec, umask (issue #15)
Add builtin dispatch in lcmd.c that checks __builtins table before fork(), so cd/exec/umask operate on the shell process itself.
This commit is contained in:
2
linit.c
2
linit.c
@@ -21,6 +21,7 @@
|
||||
#include "lauxlib.h"
|
||||
#include "llimits.h"
|
||||
#include "lcmd.h"
|
||||
#include "lbuiltin.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -100,5 +101,6 @@ LUALIB_API void luaL_openselectedlibs (lua_State *L, int load, int preload) {
|
||||
lua_assert((mask >> 1) == LUA_UTF8LIBK);
|
||||
lua_pop(L, 1); /* remove PRELOAD table */
|
||||
opencommand(L); /* register __command global */
|
||||
luaopen_builtins(L); /* register __builtins table */
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user