net.server_select: Allow setquitting("once") to allow resuming the loop later
authorMatthew Wild <mwild1@gmail.com>
Tue, 10 Apr 2018 20:40:07 +0100
changeset 8752 fb3cd6b2263b
parent 8751 2fdeb979cc7c
child 8753 7ae09468ad92
net.server_select: Allow setquitting("once") to allow resuming the loop later
net/server_select.lua
--- 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