From 78e8fddc429d5aeaa6a7343d2533c0557b6b5b9d Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Tue, 1 Nov 2016 18:51:37 +0100 Subject: [PATCH] environment: quote environment vars to allow expansion shquote() breaks backwards compat Signed-off-by: Tobias Ulmer --- local/environment.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/local/environment.lua b/local/environment.lua index f65717b..9f23f86 100644 --- a/local/environment.lua +++ b/local/environment.lua @@ -114,8 +114,7 @@ function environment.get_dict(env) end --- Write environment as key=value\n... string to file. File is created or --- truncated. Value is quoted with e2lib.shquote() so the file can be sourced --- by a shell. +-- overwritten. -- @param env Environment. -- @param file File name. -- @return True on success, false on error. @@ -128,7 +127,8 @@ function environment.tofile(env, file) out = {} for var, val in env:iter() do - table.insert(out, string.format("%s=%s\n", var, e2lib.shquote(val))) + -- no e2lib.shquote(), some projects depend on shell variable expansion + table.insert(out, string.format("%s=\"%s\"\n", var, val)) end rc, re = eio.file_write(file, table.concat(out)) -- 2.39.5