close connection when no more input is available in interactive mode

Mon, 07 Jun 2010 13:42:46 -0400

author
Hubert Chathi <hubert@uhoreg.ca>
date
Mon, 07 Jun 2010 13:42:46 -0400
changeset 36
0712fda16ab6
parent 35
37540f89d4e2
child 37
bb7a51aca282

close connection when no more input is available in interactive mode

clix/send.lua file | annotate | diff | comparison | revisions
--- a/clix/send.lua	Sun May 30 02:56:40 2010 +0100
+++ b/clix/send.lua	Mon Jun 07 13:42:46 2010 -0400
@@ -25,6 +25,9 @@
 				close = function () end;
 				receive = function (_, patt)
 					local data = io.stdin:read(patt);
+					if data == nil then
+						conn:close();
+					end
 					if opts.echo then
 						io.write(data, patt == "*l" and "\n" or "");
 					end

mercurial