From e81753b69c42ddacc9e892f3fa283059914edc73 Mon Sep 17 00:00:00 2001 From: est31 Date: Sat, 27 Feb 2016 05:26:58 +0100 Subject: [PATCH] Don't generate trailing spaces in minetest.conf.example If the default value of a setting was empty, it previously generated a trailing space. --- builtin/mainmenu/dlg_settings_advanced.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/builtin/mainmenu/dlg_settings_advanced.lua b/builtin/mainmenu/dlg_settings_advanced.lua index 35883f05..cab9f169 100644 --- a/builtin/mainmenu/dlg_settings_advanced.lua +++ b/builtin/mainmenu/dlg_settings_advanced.lua @@ -706,7 +706,11 @@ local function create_minetest_conf_example() result = result .. " possible values: " .. entry.possible:gsub(",", ", ") end result = result .. "\n" - result = result .. "# " .. entry.name .. " = ".. entry.default .. "\n\n" + local append = "" + if entry.default ~= "" then + append = " " .. entry.default + end + result = result .. "# " .. entry.name .. " =" .. append .. "\n\n" end end return result