]> git.sesse.net Git - vlc/commitdiff
luatelnet: use dedicated strip function
authorPierre Ynard <linkfanel@yahoo.fr>
Sun, 20 Mar 2011 02:31:19 +0000 (03:31 +0100)
committerPierre Ynard <linkfanel@yahoo.fr>
Sun, 20 Mar 2011 02:31:19 +0000 (03:31 +0100)
share/lua/intf/telnet.lua

index 759f256ca5c183397b9cb72167f0ea4891043fa0..b8901beb1343ae91a8eb9dcc4d36bfd8d8c10c2b 100644 (file)
@@ -42,6 +42,7 @@ description=
     * prompt: The prompt.
 ]============================================================================]
 
+require "common"
 require "host"
 
 --[[ Some telnet command special characters ]]
@@ -198,7 +199,7 @@ while not vlc.misc.should_die() do
 
             -- get the next command
             local index = string.find(client.cmds, "\n")
-            client.buffer = string.gsub(string.sub(client.cmds, 0, index - 1), "^%s*(.-)%s*$", "%1")
+            client.buffer = common.strip(string.sub(client.cmds, 0, index - 1))
             client.cmds = string.sub(client.cmds, index + 1)
 
             -- Remove telnet commands from the command line