Changeset

8749:fb3cd6b2263b

net.server_select: Allow setquitting("once") to allow resuming the loop later
author Matthew Wild <mwild1@gmail.com>
date Tue, 10 Apr 2018 20:40:07 +0100
parents 8748:2fdeb979cc7c
children 8750:7ae09468ad92
files net/server_select.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/net/server_select.lua	Tue Apr 10 20:39:05 2018 +0100
+++ b/net/server_select.lua	Tue Apr 10 20:40:07 2018 +0100
@@ -889,7 +889,7 @@
 local quitting;
 
 local function setquitting(quit)
-	quitting = not not quit;
+	quitting = quit;
 end
 
 loop = function(once) -- this is the main loop of the program
@@ -958,7 +958,7 @@
 			end
 		end
 	until quitting;
-	if once and quitting == "once" then quitting = nil; return; end
+	if quitting == "once" then quitting = nil; return; end
 	closeall();
 	return "quitting"
 end