From 1eb33969220b267cf45adb286f0b7b6d14805eff Mon Sep 17 00:00:00 2001 From: Scott Prager Date: Wed, 15 Apr 2015 13:05:30 -0400 Subject: unify jobstart, termopen, and system interfaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For any of these functions, if {cmd} is a string, execute "&shell &shellcmdflag '{cmd}'", or simply {cmd} if it's a list. In termopen(), if the 'name' option is not supplied, try to guess using '{cmd}' (string) or {cmd}[0] (list). Simplify ex_terminal to use the string form of termopen(). termopen: get name from argument Convert list_to_argv to tv_to_argv. Helped-by: Björn Linse <@bfredl> Helped-by: oni-link Helped-by: Thiago de Arruda <@tarruda> --- test/unit/os/shell_spec.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test/unit/os/shell_spec.lua') diff --git a/test/unit/os/shell_spec.lua b/test/unit/os/shell_spec.lua index 03aafe7e3c..91d807da0b 100644 --- a/test/unit/os/shell_spec.lua +++ b/test/unit/os/shell_spec.lua @@ -40,7 +40,9 @@ describe('shell functions', function() local output = ffi.new('char *[1]') local nread = ffi.new('size_t[1]') - local status = shell.os_system(to_cstr(cmd), input_or, input_len, output, nread) + local argv = ffi.cast('char**', + shell.shell_build_argv(to_cstr(cmd), nil)) + local status = shell.os_system(argv, input_or, input_len, output, nread) return status, intern(output[0], nread[0]) end -- cgit