Explorar o código

Fix: Escape sequence in gmatch patterns

Gogs hai 2 meses
pai
achega
752b20b397
Modificáronse 1 ficheiros con 2 adicións e 4 borrados
  1. 2 4
      package/src/client2server-minimal.lua

+ 2 - 4
package/src/client2server-minimal.lua

@@ -115,8 +115,7 @@ local function get_ssid_name(iface)
         local result = f:read("*a")
         f:close()
         -- Extract SSIDs from output
-        for line in result:gmatch("[^
-]+") do
+        for line in result:gmatch("[^\n]+") do
             local ssid = line:match("ssid%s+(.+)")
             if ssid and ssid ~= "" then
                 return ssid
@@ -145,8 +144,7 @@ local function get_all_ssids()
         local result = f:read("*a")
         f:close()
         local current_iface = nil
-        for line in result:gmatch("[^
-]+") do
+        for line in result:gmatch("[^\n]+") do
             -- Detect interface from "Interface wlanX-1"
             local iface = line:match("Interface%s+(wlan%d-%d)")
             if iface then