Diff

util/datamanager.lua @ 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
parent 6994:507301531cf5
child 6996:644b1bddc676
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);