* luci/applications: statistics: strip leading and trailing whitespace from config...
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 31 Aug 2008 14:50:43 +0000 (14:50 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 31 Aug 2008 14:50:43 +0000 (14:50 +0000)
applications/luci-statistics/root/usr/bin/stat-genconfig

index 071cff2ca5859a5c67e7861c854865c542b1109a..7f0a05f5febdc8ae2c1bd22de7b6b3d5b05ed12c 100755 (executable)
@@ -224,19 +224,19 @@ function _string( s, n, nopad )
        if s then
                if s:find("[^%d]") then
                        if not s:find("[^%w]") then
-                               str = pad .. n .. " " .. s
+                               str = pad .. n .. " " .. luci.util.trim(s)
                        else
-                               str = pad .. n .. ' "' .. s .. '"'
+                               str = pad .. n .. ' "' .. luci.util.trim(s) .. '"'
                        end
                else
-                       str = pad .. n .. " " .. s
+                       str = pad .. n .. " " .. luci.util.trim(s)
                end
 
                str = str .. "\n"
        end
 
        return str
-end            
+end
 
 
 plugins = {
@@ -252,7 +252,7 @@ plugins = {
                { }
        },
 
-       csv     = { 
+       csv     = {
                { "DataDir" },
                { "StoreRates" },
                { }