Changeset

6995:807b0b2ee545

util.datamanager: Skip past second check if first attemtp to open file succeeds
author Kim Alvefur <zash@zash.se>
date Fri, 11 Dec 2015 20:18:24 +0100
parents 6994:507301531cf5
children 6996:644b1bddc676
files util/datamanager.lua
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/util/datamanager.lua	Fri Dec 11 20:13:37 2015 +0100
+++ b/util/datamanager.lua	Fri Dec 11 20:18:24 2015 +0100
@@ -214,9 +214,9 @@
 	local f, msg = io_open(filename, "r+");
 	if not f then
 		f, msg = io_open(filename, "w");
-	end
-	if not f then
-		return nil, msg;
+		if not f then
+			return nil, msg;
+		end
 	end
 	local pos = f:seek("end");
 	local ok, msg = fallocate(f, pos, #data);