]> git.e2factory.org Git - e2factory.git/commitdiff
Rename arg in e2lib.parse_server_location(), add assert
authorTobias Ulmer <tu@emlix.com>
Fri, 1 Feb 2013 18:51:29 +0000 (19:51 +0100)
committerTobias Ulmer <tu@emlix.com>
Tue, 26 Feb 2013 18:07:14 +0000 (19:07 +0100)
arg is used as a hidden parameter by Lua.

Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/e2lib.lua

index e8df45f201811cf5289c6e618d16fcaaa676c019..e4d87dd620a570e977ddccaba4ee21e8caa20cad 100644 (file)
@@ -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