Merge pull request #43028 from Carbonhell/tgcode/shelleo

Escapes the quotes in the shell call
This commit is contained in:
ShizCalev
2019-03-08 03:04:36 -05:00
committed by GitHub
+4 -1
View File
@@ -25,7 +25,10 @@
shelleo_ids[shelleo_id] = TRUE
out_file = "[SHELLEO_NAME][shelleo_id][SHELLEO_OUT]"
err_file = "[SHELLEO_NAME][shelleo_id][SHELLEO_ERR]"
errorcode = shell("[interpreter] \"[command]\" > [out_file] 2> [err_file]")
if(world.system_type == UNIX)
errorcode = shell("[interpreter] \"[replacetext(command, "\"", "\\\"")]\" > [out_file] 2> [err_file]")
else
errorcode = shell("[interpreter] \"[command]\" > [out_file] 2> [err_file]")
if(fexists(out_file))
stdout = file2text(out_file)
fdel(out_file)