Replace Dos line endings with Unix ones where needed
authorSteven Barth <steven@midlink.org>
Tue, 20 Jan 2009 11:33:33 +0000 (11:33 +0000)
committerSteven Barth <steven@midlink.org>
Tue, 20 Jan 2009 11:33:33 +0000 (11:33 +0000)
modules/admin-full/luasrc/model/cbi/admin_services/crontab.lua
modules/admin-full/luasrc/model/cbi/admin_system/ipkg.lua
modules/admin-full/luasrc/model/cbi/admin_system/sshkeys.lua

index 7a9750f..521e0a2 100644 (file)
@@ -26,10 +26,10 @@ end
 function f.handle(self, state, data)
        if state == FORM_VALID then
                if data.crons then
-                       luci.fs.writefile(cronfile, data.crons)
+                       luci.fs.writefile(cronfile, data.crons:gsub("\r\n", "\n"))
                end
        end
        return true
 end
 
-return f
\ No newline at end of file
+return f
index a93b4b0..fecc294 100644 (file)
@@ -23,7 +23,7 @@ function t.cfgvalue()
 end
 
 function t.write(self, section, data)
-       return luci.fs.writefile(ipkgfile, data)
+       return luci.fs.writefile(ipkgfile, data:gsub("\r\n", "\n"))
 end
 
 f:append(Template("admin_system/ipkg"))
index 1c5569c..26410c9 100644 (file)
@@ -26,10 +26,10 @@ end
 function f.handle(self, state, data)
        if state == FORM_VALID then
                if data.keys then
-                       luci.fs.writefile(keyfile, data.keys)
+                       luci.fs.writefile(keyfile, data.keys:gsub("\r\n", "\n"))
                end
        end
        return true
 end
 
-return f
\ No newline at end of file
+return f