From 7bdefc8d42e1f682ad978e40b960725e1c232660 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Tue, 4 Jul 2023 19:10:05 +0100 Subject: [PATCH] split_shell: comment out debug --- worldeditadditions_core/utils/strings/split_shell.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/worldeditadditions_core/utils/strings/split_shell.lua b/worldeditadditions_core/utils/strings/split_shell.lua index 33e349e..7a6501b 100644 --- a/worldeditadditions_core/utils/strings/split_shell.lua +++ b/worldeditadditions_core/utils/strings/split_shell.lua @@ -22,7 +22,7 @@ local function split_shell(text, autotrim) local acc = {} local mode = "NORMAL" -- NORMAL, INSIDE_QUOTES_SINGLE, INSIDE_QUOTES_DOUBLE - print("\n\n\n\n\nDEBUG:split_shell START text", text, "autotrim", autotrim) + -- print("\n\n\n\n\nDEBUG:split_shell START text", text, "autotrim", autotrim) for i=1,text_length do local prevchar = "" @@ -64,7 +64,7 @@ local function split_shell(text, autotrim) table.insert(acc, curchar) end elseif mode == "INSIDE_QUOTES_SINGLE" then - if curchar == "'" and prevchar ~= "\\" and is_whitespace(nextchar) then + if curchar == "'" and prevchar ~= "\\" and (is_whitespace(nextchar) or nextchar == "") then -- It's the end of a quote! mode = "NORMAL" elseif (curchar == "\\" and (