From owner-svn-src-head@freebsd.org Sat Feb 24 03:47:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B60B0F10A8D; Sat, 24 Feb 2018 03:47:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6986E6AD7C; Sat, 24 Feb 2018 03:47:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 641DF200F3; Sat, 24 Feb 2018 03:47:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1O3l42r072693; Sat, 24 Feb 2018 03:47:04 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1O3l4YV072692; Sat, 24 Feb 2018 03:47:04 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802240347.w1O3l4YV072692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 24 Feb 2018 03:47:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329901 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329901 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Feb 2018 03:47:04 -0000 Author: kevans Date: Sat Feb 24 03:47:04 2018 New Revision: 329901 URL: https://svnweb.freebsd.org/changeset/base/329901 Log: lualoader: Add comment on trailing space, don't operate on nil Functionally, the latter error wouldn't necessarily hurt anything. io.write will just error out as it's not passed a valid file handle. Still, we can do better than that. Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Sat Feb 24 03:45:50 2018 (r329900) +++ head/stand/lua/config.lua Sat Feb 24 03:47:04 2018 (r329901) @@ -141,8 +141,14 @@ local function check_nextboot() end local nfile = io.open(nextboot_file, 'w') - io.write(nfile, "nextboot_enable=\"NO\" ") - io.close(nfile) + if nfile ~= nil then + -- We're overwriting the first line of the file, so we need the + -- trailing space to account for the extra character taken up by + -- the string nextboot_enable="YES" -- our new end quotation + -- mark lands on the S. + io.write(nfile, "nextboot_enable=\"NO\" ") + io.close(nfile) + end end -- Module exports