X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=modules%2Fluci-base%2Fluasrc%2Futil.lua;h=a30e8b72f31466d28bec20792c6648c9b6989cb2;hb=09b2d8a8ac6ca14cfa91168e3f3d1a102e6b62fb;hp=f16b3afb2e236ef3489cb58b14ab9e1cf893c2d7;hpb=0ca5e4db0e779adb5e3ebdbfce13ba6916fb5645;p=oweals%2Fluci.git diff --git a/modules/luci-base/luasrc/util.lua b/modules/luci-base/luasrc/util.lua index f16b3afb2..a30e8b72f 100644 --- a/modules/luci-base/luasrc/util.lua +++ b/modules/luci-base/luasrc/util.lua @@ -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