svn commit: r329688 - head/stand/lua

Kyle Evans kevans at FreeBSD.org
Wed Feb 21 01:50:47 UTC 2018


Author: kevans
Date: Wed Feb 21 01:50:46 2018
New Revision: 329688
URL: https://svnweb.freebsd.org/changeset/base/329688

Log:
  lualoader: Don't return false for failure to open config on silent parse

Modified:
  head/stand/lua/config.lua

Modified: head/stand/lua/config.lua
==============================================================================
--- head/stand/lua/config.lua	Wed Feb 21 01:39:33 2018	(r329687)
+++ head/stand/lua/config.lua	Wed Feb 21 01:50:46 2018	(r329688)
@@ -270,13 +270,17 @@ function config.loadmod(mod, silent)
 	return status
 end
 
+-- silent runs will not return false if we fail to open the file
 function config.parse(name, silent)
+	if silent == nil then
+		silent = false
+	end
 	local f = io.open(name)
 	if f == nil then
 		if not silent then
 			print("Failed to open config: '" .. name .. "'")
 		end
-		return false
+		return silent
 	end
 
 	local text
@@ -288,7 +292,7 @@ function config.parse(name, silent)
 		if not silent then
 			print("Failed to read config: '" .. name .. "'")
 		end
-		return false
+		return silent
 	end
 
 	local n = 1


More information about the svn-src-all mailing list