Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Feb 2018 01:50:46 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r329688 - head/stand/lua
Message-ID:  <201802210150.w1L1oktb014993@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802210150.w1L1oktb014993>