From 68295fb64b9478727139858909772dc64e4264bb Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Fri, 1 Feb 2013 19:51:29 +0100 Subject: [PATCH] Rename arg in e2lib.parse_server_location(), add assert arg is used as a hidden parameter by Lua. Signed-off-by: Tobias Ulmer --- generic/e2lib.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/generic/e2lib.lua b/generic/e2lib.lua index e8df45f..e4d87dd 100644 --- a/generic/e2lib.lua +++ b/generic/e2lib.lua @@ -1862,15 +1862,16 @@ function e2lib.read_template(file) end --- parse a server:location string, taking a default server into account --- @param arg string: the string to parse +-- @param serverloc string: the string to parse -- @param default_server string: the default server name -- @return a table with fields server and location, nil on error -- @return nil, an error string on error -function e2lib.parse_server_location(arg, default_server) +function e2lib.parse_server_location(serverloc, default_server) + assert(type(serverloc) == 'string' and type(default_server) == 'string') local sl = {} - sl.server, sl.location = arg:match("(%S+):(%S+)") + sl.server, sl.location = serverloc:match("(%S+):(%S+)") if not (sl.server and sl.location) then - sl.location = arg:match("(%S+)") + sl.location = serverloc:match("(%S+)") if not (sl.location and default_server) then return nil, "can't parse location" end -- 2.39.5