Revert part of r22952 which broke commands of more than 1000 chars.
authorAntoine Cellerier <dionoea@videolan.org>
Mon, 5 Nov 2007 20:46:41 +0000 (20:46 +0000)
committerAntoine Cellerier <dionoea@videolan.org>
Mon, 5 Nov 2007 20:46:41 +0000 (20:46 +0000)
share/luaintf/rc.lua

index e2e4f3a..c95f1a0 100644 (file)
@@ -464,19 +464,20 @@ while not vlc.should_die() do
 
     for _, client in pairs(read) do
         local input = client:recv(1000)
+        local done = false
         if string.match(input,"\n$") then
             client.buffer = string.gsub(client.buffer..input,"\r?\n$","")
+            done = true
         elseif client.buffer == ""
            and ((client.type == host.client_type.stdio and input == "")
            or  (client.type == host.client_type.net and input == "\004")) then
             -- Caught a ^D
             client.buffer = "quit"
+            done = true
         else
             client.buffer = client.buffer .. input
         end
-        if client.buffer == "" then
-            client:send( client.env.prompt )
-        else
+        if done then
             local cmd,arg = split_input(client.buffer)
             client.buffer = ""
             client:switch_status(host.status.write)