From: Hannu Nyman Date: Sun, 20 Mar 2016 11:12:05 +0000 (+0200) Subject: luci-base: fix bug in util.lua in 'shellsqescape' X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=e2e2696430363eb22d5e890c8f0ca28d56434d19;hp=355c21304afb0d388fb8bd6132e0dbcb19f03428 luci-base: fix bug in util.lua in 'shellsqescape' Fix a bug introduced by #561 Function 'shellsqescape' calls 'gsub' with the empty result string 'res' instead of the actual parameter 'value'. This leads into error: .../util.lua:160: bad argument #1 to 'gsub' (string expected, got nil) Fix error by passing the correct parameter to the function. After the fix, the unmount button introduced by #561 finally works. Signed-off-by: Hannu Nyman --- diff --git a/modules/luci-base/luasrc/util.lua b/modules/luci-base/luasrc/util.lua index 5bf0beb6c..2956aadcf 100644 --- a/modules/luci-base/luasrc/util.lua +++ b/modules/luci-base/luasrc/util.lua @@ -157,7 +157,7 @@ end -- command line parameter). function shellsqescape(value) local res - res, _ = string.gsub(res, "'", "'\\''") + res, _ = string.gsub(value, "'", "'\\''") return res end