From 3ff92ba1ee54a9400aac143f4d98d356dc6a8321 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Tue, 23 Jan 2018 17:56:50 -0500 Subject: eval: save_tv_as_string: Correctly handle an empty string When tv_get_string_chk returns a non-NULL value, we have a valid string. Propagating an error state (*len = -1, NULL return) for an empty string is invalid. Closes #6554 --- test/functional/eval/system_spec.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test') diff --git a/test/functional/eval/system_spec.lua b/test/functional/eval/system_spec.lua index 66d569416e..77e7424452 100644 --- a/test/functional/eval/system_spec.lua +++ b/test/functional/eval/system_spec.lua @@ -258,6 +258,9 @@ describe('system()', function() end eq(2, eval("1+1")) -- Still alive? end) + it('works with an empty string', function() + eq("test\n", eval('system("echo test", "")')) + end) end) describe('passing a lot of input', function() -- cgit