Changeset

12558:0f71106448af

Merge 0.12->trunk
author Kim Alvefur <zash@zash.se>
date Sun, 19 Jun 2022 19:58:12 +0200
parents 12556:706375b75475 (current diff) 12557:ee5b061588ea (diff)
children 12559:865631ebb9f2
files
diffstat 1 files changed, 8 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/net/unbound.lua	Tue Jun 14 22:06:21 2022 +0200
+++ b/net/unbound.lua	Sun Jun 19 19:58:12 2022 +0200
@@ -28,19 +28,16 @@
 local builtin_defaults = { hoststxt = false }
 
 local function add_defaults(conf)
-	if conf then
-		for option, default in pairs(builtin_defaults) do
-			if conf[option] == nil then
-				conf[option] = default;
-			end
+	conf = conf or {};
+	for option, default in pairs(builtin_defaults) do
+		if conf[option] == nil then
+			conf[option] = default;
 		end
-		for option, default in pairs(libunbound.config) do
-			if conf[option] == nil then
-				conf[option] = default;
-			end
+	end
+	for option, default in pairs(libunbound.config) do
+		if conf[option] == nil then
+			conf[option] = default;
 		end
-	else
-		return builtin_defaults;
 	end
 	return conf;
 end