Translated using Weblate (Portuguese)
[oweals/luci.git] / modules / luci-base / luasrc / util.lua
index f16b3afb2e236ef3489cb58b14ab9e1cf893c2d7..a30e8b72f31466d28bec20792c6648c9b6989cb2 100644 (file)
@@ -207,9 +207,8 @@ end
 -- handling.  It may actually be a property of the getopt function
 -- rather than the shell proper.
 function shellstartsqescape(value)
-   res, _ = string.gsub(value, "^\-", "\\-")
-   res, _ = string.gsub(res, "^-", "\-")
-   return shellsqescape(value)
+   res, _ = string.gsub(value, "^%-", "\\-")
+   return shellsqescape(res)
 end
 
 -- containing the resulting substrings. The optional max parameter specifies
@@ -262,7 +261,7 @@ end
 
 -- one token per invocation, the tokens are separated by whitespace. If the
 -- input value is a table, it is transformed into a string first. A nil value
--- will result in a valid interator which aborts with the first invocation.
+-- will result in a valid iterator which aborts with the first invocation.
 function imatch(v)
        if type(v) == "table" then
                local k = nil