Page MenuHomeFreeBSD

D14580.id.diff
No OneTemporary

D14580.id.diff

Index: head/stand/liblua/lutils.c
===================================================================
--- head/stand/liblua/lutils.c
+++ head/stand/liblua/lutils.c
@@ -97,6 +97,24 @@
}
static int
+lua_parse(lua_State *L)
+{
+ int argc, nargc;
+ char **argv;
+
+ if (parse(&argc, &argv, luaL_checkstring(L, 1)) == 0) {
+ for (nargc = 0; nargc < argc; ++nargc) {
+ lua_pushstring(L, argv[nargc]);
+ }
+ free(argv);
+ return nargc;
+ }
+
+ lua_pushnil(L);
+ return 1;
+}
+
+static int
lua_getchar(lua_State *L)
{
@@ -325,6 +343,7 @@
REG_SIMPLE(delay),
REG_SIMPLE(command),
REG_SIMPLE(interpret),
+ REG_SIMPLE(parse),
REG_SIMPLE(getenv),
REG_SIMPLE(perform),
/* Also registered as the global 'printc' */
Index: head/stand/lua/cli.lua
===================================================================
--- head/stand/lua/cli.lua
+++ head/stand/lua/cli.lua
@@ -94,6 +94,10 @@
end
+function cli.execute_unparsed(str)
+ cli_execute(loader.parse(str))
+end
+
-- Module exports
function cli.boot(...)

File Metadata

Mime Type
text/plain
Expires
Thu, Jul 2, 12:19 AM (18 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34581698
Default Alt Text
D14580.id.diff (1 KB)

Event Timeline